• Sam Lantinga's avatar
    Fixed bug 1943 - Wrong handling of legacy 32bpp BMP files · d4b269bc
    Sam Lantinga authored
    Kang Seonghoon
    
    While BMP format supports alpha channel, it is enabled only when the header is at least 56 bytes long (BITMAPV3INFOHEADER and later). For very common 40-byte-long header (BITMAPINFOHEADER) 32bpp format should be interpreted as BGRX format, but currently SDL interprets them as BGRA format and causes a significant compatibility problem as many 32bpp files use a padding byte of 0 ("transparent" in BGRA interpretation).
    
    ---
    
    I fixed this by checking to see if the alpha channel is all 0, and if so, setting it opaque.
    d4b269bc
Name
Last commit
Last update
VisualC Loading commit data...
VisualCE Loading commit data...
Xcode Loading commit data...
Xcode-iOS/SDL_image.xcodeproj Loading commit data...
acinclude Loading commit data...
debian Loading commit data...
external Loading commit data...
.hgignore Loading commit data...
Android.mk Loading commit data...
CHANGES.txt Loading commit data...
COPYING.txt Loading commit data...
IMG.c Loading commit data...
IMG_ImageIO.m Loading commit data...
IMG_UIImage.m Loading commit data...
IMG_bmp.c Loading commit data...
IMG_gif.c Loading commit data...
IMG_jpg.c Loading commit data...
IMG_lbm.c Loading commit data...
IMG_pcx.c Loading commit data...
IMG_png.c Loading commit data...
IMG_pnm.c Loading commit data...
IMG_tga.c Loading commit data...
IMG_tif.c Loading commit data...
IMG_webp.c Loading commit data...
IMG_xcf.c Loading commit data...
IMG_xpm.c Loading commit data...
IMG_xv.c Loading commit data...
IMG_xxx.c Loading commit data...
Makefile.am Loading commit data...
Makefile.in Loading commit data...
README.txt Loading commit data...
SDL2_image.pc.in Loading commit data...
SDL2_image.spec Loading commit data...
SDL2_image.spec.in Loading commit data...
SDL_image.h Loading commit data...
aclocal.m4 Loading commit data...
autogen.sh Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
depcomp Loading commit data...
gcc-fat.sh Loading commit data...
install-sh Loading commit data...
ltmain.sh Loading commit data...
miniz.h Loading commit data...
missing Loading commit data...
showimage.c Loading commit data...
version.rc Loading commit data...