SDL_Image : unsupported image format

I have got a problem on my laptop and doesn’t know where it comes from … (when I compile my program on my friend’s computer there is no error and all work fine !)
I Have got this error “unsupported image format” when I use the method “IMG_Load” with a jpeg or a png …
I use the last version of SDL and SDL_Image.

Does anybody know what am I suppose to do to fix this error please ?
Should I download some additional packages ?
Thanks.

It sounds like your friend has some extra development libraries installed. For jpeg I believe you need libjpeg. For png you need both libpng and zlib. You’ll also need the png and zlib DLLs with your program if you are working with Windows.

I hope this helps!

matthoffman wrote:> I have got a problem on my laptop and doesn’t know where it comes from … (when I compile my program on my friend’s computer there is no error and all work fine !)

I Have got this error “unsupported image format” when I use the method “IMG_Load” with a jpeg or a png …
I use the last version of SDL and SDL_Image.

Does anybody know what am I suppose to do to fix this error please ?
Should I download some additional packages ?
Thanks.

I am working with Ubuntu and I already have libjpeg, zlib and libpng on my computer … but still no working

That seems to be so strange …

:frowning:

matthoffman wrote:

I am working with Ubuntu and I already have libjpeg, zlib and libpng on my computer … but still no working

That seems to be so strange …

Try this:
http://ubuntuforums.org/showthread.php?t=1023655

HTH

Peter K

I am working with Ubuntu and I already have libjpeg, zlib and libpng on
my computer … but still no working

You didn’t mention which version of Ubuntu, which could make a difference.
Also, when was the last time you updated your Ubuntu installation? That
could cause problems too.

How did you install SDL and SDL image? If you used apt-get or synaptic then
try reinstalling all the libsdl*.dev packages. That should make sure you
have everything you need installed. If you installed them by hand then
please, install them using apt-get or synaptic.

An other thing to check is to make sure you have the image file you want
where you think it is. Seriously, it is very easy to forget a file or to
drop it in a different directory than the one you thought you put it in.
That and the occasional wrong case character in a name have tripped me up
many times. Moving back and forth between Linux and Windows you also have to
look for the effects of a \ when used on Linux. You get in the habit of
using \ on Windows/Dos and then you do it on Linux and wind up adding an
extra character, or even part of the path, to your file names. That last bit
can add an space character to the end of the file name. Damned hard to see a
blank at the end of a file name. :slight_smile:

Last, but not least, if the file really is where your program expects it to
be and it is named correctly (including the file name extension and case)
then open it with something like gimp and see what type it really is. Files
can get corrupted and what you think is a jpeg is not really a jpeg. If you
have a corrupt copy of the file, the jpeg library will not open it. The
thing is, even if it says .jpg at the end of the file, you may not have a
valid .jpg image. The SDL image code looks at the file time info in the
file
not the extension, to determine if it can open the file.

Bob PendletonOn Mon, Jan 4, 2010 at 10:53 AM, matthoffman wrote:

That seems to be so strange …

[image: Sad]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------