SDL_Image unsupported format for all formats

Every time I try to load an image using SDL_image.h it just throws an error.

Well, to be honest I’ve only tested .bmp, .png, jpeg, and .tga.

bmp, png, jpeg: “unsupported image format”

tga: “Error writing to datastream”

I’m not sure what I need to do to get the library to work.

I’m on Slackware and I’ve used the Slackbuild.
I’ve also downloaded the latest source release along with one from the
Mercurial. All of the sources appear to compile configure/make/install
just fine. I even have the extra support for jpeg and png.

(Loading bitmaps from SDL2 was working just fine if that helps).

I’m also worried about the other posts in the mailing list stating that
SDL_image doesn’t preserve alpha. I originally wanted to switch from bmp
to tga solely for the alpha channel. Before I was just converting bmp to
surface to opengl texture.

Any advice for the best way to get tga -> opengl texture and the
SDL_image library working would be much appreciated.

I don’t have any suggestion about what the problem is, but I can clarify
the alpha issue so that it doesn’t worry you.

The “SDL 2.0 and PNG alpha” thread has nothing to do with SDL_image’s alpha
support. SDL_image supports alpha channels perfectly. The .tga format is
great for that.

The problem in that thread was with a fake display surface (
SDL_GetWindowSurface()) no longer (since SDL 2.0) supporting conversions to
optimized formats with alpha since SDL_DisplayFormatAlpha() is not in SDL
2. This is an understandable issue, but for some reason there is a
performance penalty regardless.

Jonny DOn Tue, Oct 14, 2014 at 11:34 PM, Justin Agrell wrote:

Every time I try to load an image using SDL_image.h it just throws an
error.

Well, to be honest I’ve only tested .bmp, .png, jpeg, and .tga.

bmp, png, jpeg: “unsupported image format”

tga: “Error writing to datastream”

I’m not sure what I need to do to get the library to work.

I’m on Slackware and I’ve used the Slackbuild.
I’ve also downloaded the latest source release along with one from the
Mercurial. All of the sources appear to compile configure/make/install
just fine. I even have the extra support for jpeg and png.

(Loading bitmaps from SDL2 was working just fine if that helps).

I’m also worried about the other posts in the mailing list stating that
SDL_image doesn’t preserve alpha. I originally wanted to switch from bmp
to tga solely for the alpha channel. Before I was just converting bmp to
surface to opengl texture.

Any advice for the best way to get tga -> opengl texture and the
SDL_image library working would be much appreciated.


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

Excellent, thanks for clearing that up for me. I was worried.

I’m also going to try my source on my Ubuntu machine. If i discover any
clues as to why SDL_image won’t work I’ll update everyone.On 10/15/2014 08:51 AM, sdl-request at lists.libsdl.org wrote:

I don’t have any suggestion about what the problem is, but I can clarify
the alpha issue so that it doesn’t worry you.

The “SDL 2.0 and PNG alpha” thread has nothing to do with SDL_image’s alpha
support. SDL_image supports alpha channels perfectly. The .tga format is
great for that.

The problem in that thread was with a fake display surface (
SDL_GetWindowSurface()) no longer (since SDL 2.0) supporting conversions to
optimized formats with alpha since SDL_DisplayFormatAlpha() is not in SDL
2. This is an understandable issue, but for some reason there is a
performance penalty regardless.

Jonny D