Export to GitHub

libgdx - issue #761

Exception loading pixmap


Posted on Mar 22, 2012 by Massive Kangaroo

I use a jpg texture 'jeros.jpg' that generates an exception on loading: (link to the image -> http://dl.dropbox.com/u/5854964/jeros.jpg)

com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: jeros.jpg at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140) at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTextureData.java:64) at com.badlogic.gdx.graphics.Texture.load(Texture.java:175) at com.badlogic.gdx.graphics.Texture.create(Texture.java:159) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133) at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:126) ...

maybe something wrong related to this image encoding?

I think this image is retouched on photoshop, I did a quick conversion using "Windows Paint" bundled app (just rewriting the image again to jpg, turning 147KB to 84,7KB) and the new version is correctly loaded

maybe the first one has no compression at all?

Comment #1

Posted on Apr 3, 2012 by Massive Horse

This is a known issue with stb-truetype, the C library we use to load images. I'm afraid we can't fix this at this point, as it would mean we'd have to change to a different (bigger) library. The current way to solve this is to convert your images in some way (Gimp, Paint, playing around with export options in Photoshop).

Comment #2

Posted on Nov 18, 2012 by Swift Cat

The jeros.jpg is a Progressive JPEG, save it without the "Progressive" options and it should work !

Status: WontFix

Labels:
Type-Defect Priority-Medium