Does IMG_Load return a null surface if it failed to load the specified file for other people?

Because I’m quite sure it doesn’t for me. I’m using SDL_image to load
pngs, and if it fails it returns some sort of invalid pointer or something.

It isn’t much hassle just to use a boost::filesystem::exists before
attempting to load a picture, but it would appear the documentation
doesn’t hold true, at least not for me.

James

Because I’m quite sure it doesn’t for me. I’m using SDL_image to load
pngs, and if it fails it returns some sort of invalid pointer or
something.

It works fine for me. Wesnoth relies extensively on IMG_Load returning NULL
if the file is non-existent, and I have never had a bug report that I’ve
traced back to this. Wesnoth has users on MacOSX, Windows, and Linux, among
other systems.

TTF_OpenFont() from SDL_ttf is a different story though – it crashes for me
if I give it a filename that doesn’t exist.

David White
Lead Developer
Battle for Wesnoth (http://www.wesnoth.org)

Because I’m quite sure it doesn’t for me. I’m using SDL_image to load
pngs, and if it fails it returns some sort of invalid pointer or
something.

It works fine for me. Wesnoth relies extensively on IMG_Load returning NULL
if the file is non-existent, and I have never had a bug report that I’ve
traced back to this. Wesnoth has users on MacOSX, Windows, and Linux, among
other systems.

TTF_OpenFont() from SDL_ttf is a different story though – it crashes for me
if I give it a filename that doesn’t exist.

The TTF_OpenFont issue is supposed to be fixed in CVS now

MarkOn Wed, 2004-04-14 at 17:20, David White wrote:

David White
Lead Developer
Battle for Wesnoth (http://www.wesnoth.org)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Because I’m quite sure it doesn’t for me. I’m using SDL_image to load
pngs, and if it fails it returns some sort of invalid pointer or
something.

It works fine for me. Wesnoth relies extensively on IMG_Load returning NULL
if the file is non-existent, and I have never had a bug report that I’ve
traced back to this. Wesnoth has users on MacOSX, Windows, and Linux, among
other systems.

OK, hang on, sorry, it was in fact a stupid error on my part and nothing
at all to do with SDL_image.

JamesOn Wed, 14 Apr 2004 17:20:00 -0500, David White wrote: