We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2899

Summary: IMG_Load_RW does not set PixelFormat of attached image correctly
Product: SDL_image Reporter: Tobbi <tobbi.bugs>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: 2.0.0   
Hardware: x86   
OS: Other   
Attachments: example file this was tried on

Description Tobbi 2015-03-07 18:09:18 UTC
Created attachment 2058 [details]
example file this was tried on

I noticed this with the attached file (for example).

I'm trying to load it via this command:
image = IMG_Load_RW(get_physfs_SDLRWops(filename), 1);

The image appears white because the format information seems to be set to 0.

Here is an example debug output:
/images/tiles/waterfall/waterfall-1.png: 
(Format)318769153
(Bits per Pixel)
(Bytes per Pixel)
(RMask)0
(GMask)0
(BMask)0
(AMask)0
Comment 1 Sylvain 2017-09-11 19:06:52 UTC
I tried and it displays correctly.
format "318769153" is SDL_PIXELFORMAT_INDEX8, which is a palette.
(you can use "SDL_GetPixelFormatName(format)")