Advertisement

SDL_image code suddenly stopped working.

Started by July 20, 2012 04:29 PM
2 comments, last by mrjones 12 years, 4 months ago
I don't understand what's going on, I have these same two images that have been in a minor little test project I have that were loaded and rendered to the screen. It worked when I last used it. Now today, probably a week or so later, I try to recompile it, it doesn't work. Same code, but I get an error that it's an unsupported image format. That's impossible. I used these images before, and they're simple jpg files.

This is how I loaded each image:


SDL_Surface* img = IMG_Load(file);


"file" is just part of a this function: GLuint LoadTexture(const char* file)

Well, I'm at a loss, I didn't change the code since last use, and it worked fine then. Just so you know, I'm running Linux Mint as my OS with Code::Blocks as my IDE.
Ideas that first pop into mind are:
1. Did you somehow manage to install another version of SDL library on your system that gets linking priority?
2. Did you either change project settings or project failed to save properly last time you changed it?
3. Did you update Code::Blocks or gcc?

In other words, what might have been something else related, but not immediately obvious that you or something automated on your system might have done? Just to be safe, I'd try to open the JPG files with something else as it is the easiest thing to check and maybe they have become corrupt somehow.
Advertisement
I don't recall installing another version of the SDL library, but I'll look into that, and I didn't alter the project settings, just the build options to link needed libraries. I also didn't update Code::Blocks or GCC.

Edit: Oh yeah, I have opened the JPG files. They appear to be perfectly normal.
I am not entirely certain about how things work on *nix systems, but zlib or libjpg might also be somehow related to the problem.

This topic is closed to new replies.

Advertisement