1
Graphics / PNG loader might be broken in 1.2
« on: April 17, 2008, 07:33:36 am »
No, I made the changes myself, to the file included in version 1.2 of sfml.
I see that changing them to uint32 makes them unsigned ints, as defined in stb_image_aug.c on line 74:
I don't know if they should be unsigned ints, but image loading seems to work fine after the change.
Ahh, now I see that line 645 is the culprit:
If I change that to:
it no longer gives the "Failed to load image "thenameofyourimage.png". Reason : Corrupt PNG" error.
I don't know, maybe the other unsigned longs need changing (to be safe with 64 bit) as well?
I see that changing them to uint32 makes them unsigned ints, as defined in stb_image_aug.c on line 74:
Code: [Select]
typedef unsigned int uint32;
I don't know if they should be unsigned ints, but image loading seems to work fine after the change.
Ahh, now I see that line 645 is the culprit:
Code: [Select]
static unsigned long code_buffer; // jpeg entropy-coded buffer
If I change that to:
Code: [Select]
static uint32 code_buffer; // jpeg entropy-coded buffer
it no longer gives the "Failed to load image "thenameofyourimage.png". Reason : Corrupt PNG" error.
I don't know, maybe the other unsigned longs need changing (to be safe with 64 bit) as well?