IMG_Load() not working under Windows CE

Hello,

I am porting my application from Win32 to Windows CE using SDL 1.2

And I have stucked due to very weird and stupid problem.
I am unable to load any images under Windows CE using SDL_image functions
however those images can be opened using standard fopen() function

images are correct has about few kB (no memory overflow possible)

As you may know Windows CE does not have relative path. All paths must be
absolute.

I know that SDL uses for file r/w operations native functions, however
TTF_OpenFont() works correctly (using the same file r/w API)

So here is my ghost code (for demonstration using absolute path on my storage
card)

g_font = TTF_OpenFont("\Storage Card\DejaVuSansCondensed.ttf", 16);
if(g_font)
printf(“Font loaded\n”);
}

FILE *fp = fopen("\\Storage Card\\icon.bmp", "rb");

if (fp != NULL)
{
	printf("image file exists\n");
	fclose(fp);
}

SDL_Surface* surface;
surface = IMG_Load("\\Storage Card\\icon.bmp");

if (surface == NULL)
{
	printf("unable to load image, funny\n");
}

output
Font loaded
image file exists
unable to load image, funny

Of course I have tried different images and extensions

stderr is empty…

Am I missing something?

Thank You for any suggestions and comments

Doesn’t look to me like you’re missing anything. If the file exists and IMG_Load doesn’t load it,
there are 2 possibilities. Either the file isn’t a valid image, or IMG_Load doesn’t work right on
WinCE. Probably the latter.

Try copying the code from the IMG_Load routine and the specific routine for your format type
that it calls into your project, so you can trace it more easily and find out where the point of
failure is. Then you can either submit a patch and improve SDL, or if fixing it turns out to be
over your head you can at least submit a bugrep with detailed information about how and where
it fails.> ----- Original Message -----

From: techi@techi.name (Techi)
To: sdl at libsdl.org
Sent: Tuesday, December 23, 2008 3:35:21 PM
Subject: [SDL] IMG_Load() not working under Windows CE

Hello,

I am porting my application from Win32 to Windows CE using SDL 1.2

And I have stucked due to very weird and stupid problem.
I am unable to load any images under Windows CE using SDL_image functions
however those images can be opened using standard fopen() function

images are correct has about few kB (no memory overflow possible)

As you may know Windows CE does not have relative path. All paths must be
absolute.

I know that SDL uses for file r/w operations native functions, however
TTF_OpenFont() works correctly (using the same file r/w API)

So here is my ghost code (for demonstration using absolute path on my storage
card)

g_font = TTF_OpenFont("\Storage Card\DejaVuSansCondensed.ttf", 16);
if(g_font)
printf(“Font loaded\n”);
}

FILE *fp = fopen("\\Storage Card\\icon.bmp", "rb");

if (fp != NULL)
{
    printf("image file exists\n");
    fclose(fp);
}

SDL_Surface* surface;
surface = IMG_Load("\\Storage Card\\icon.bmp");

if (surface == NULL)
{
    printf("unable to load image, funny\n");
}

output
Font loaded
image file exists
unable to load image, funny

Of course I have tried different images and extensions

stderr is empty…

Am I missing something?

Thank You for any suggestions and comments


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