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

Summary: SDL_LoadBMP loads 8-bit images incorrectly
Product: SDL Reporter: driedfruit <driedfruit>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: trivial    
Priority: P2 CC: martin.gerhardy
Version: HG 2.0   
Hardware: x86   
OS: Linux   
Attachments: patch to fix the issue

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.