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 - IMG_Load_RW does not set PixelFormat of attached image correctly
Summary: IMG_Load_RW does not set PixelFormat of attached image correctly
Status: RESOLVED INVALID
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.0
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-07 18:09 UTC by Tobbi
Modified: 2017-09-11 19:06 UTC (History)
1 user (show)

See Also:


Attachments
example file this was tried on (6.32 KB, image/png)
2015-03-07 18:09 UTC, Tobbi
Details

Note You need to log in before you can comment on or make changes to this bug.
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)")