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 1811 - SDL_LoadBMP loads 8-bit images incorrectly
Summary: SDL_LoadBMP loads 8-bit images incorrectly
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 trivial
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-18 05:30 UTC by driedfruit
Modified: 2013-04-18 07:26 UTC (History)
1 user (show)

See Also:


Attachments
patch to fix the issue (558 bytes, text/plain)
2013-04-18 05:30 UTC, driedfruit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description driedfruit 2013-04-18 05:30:10 UTC
Created attachment 1115 [details]
patch to fix the issue

Since the change to SDL_Color to allow the alpha component, SDL_LoadBMP_RW handles alpha for 8-bit palletized images incorrectly.

4th byte in the RGBQUAD structure is always zero, not the alpha.

As seen here
 http://msdn.microsoft.com/en-us/library/windows/desktop/dd162938(v=vs.85).aspx
or here 
 http://msdn.microsoft.com/en-us/library/aa922960.aspx

Note: there might be similar problems in other image formats in SDL_image.
Comment 1 Martin Gerhardy 2013-04-18 07:10:32 UTC
isn't this obsolete since http://hg.libsdl.org/SDL/rev/1fa727447de3 ?
Comment 2 driedfruit 2013-04-18 07:26:01 UTC
Oh, absolutely. Terribly sorry for not noticing that.