From a1a2202ebec15c6ba4c77e0eaf94bb698ab81530 Mon Sep 17 00:00:00 2001 From: Jonah Jeleniewski Date: Mon, 8 Apr 2024 21:16:39 +1000 Subject: [PATCH] Add support for bitmaps with header size 56 Size 56 is the undocumented `BITMAPV3INFOHEADER`. It adds the alpha bit mask. The format is known to be supported by: - Windows (MS paint, etc.) - Adobe Photoshop - Popular web browsers --- Tests/images/bmp/q/rgba32h56.bmp | Bin 0 -> 32582 bytes Tests/test_bmp_reference.py | 1 + src/PIL/BmpImagePlugin.py | 4 ++-- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Tests/images/bmp/q/rgba32h56.bmp diff --git a/Tests/images/bmp/q/rgba32h56.bmp b/Tests/images/bmp/q/rgba32h56.bmp new file mode 100644 index 0000000000000000000000000000000000000000..343baa3300f331aaeabeb40d8fcd2f232393e815 GIT binary patch literal 32582 zcmcKDPi$NFq3C%IMhgPN1%cs$1-M`V0>dt};DW%g0|CPVd;kk*02Rw9tZ! zGaoj#WBWF__xARs{YI2@cz(b0`^bt8#bf@Y|G%9G{q3Ls=HLIfy6^tK`rksy(Esjj z_XGdu|M5-Tcc1?ggo04_|NiOzI|zltK`0sxLO=LH5c=T{gV2wD6ofLFAoSxO2ce(* zBnbWVr$OjvKMO)X|9KGlJ`F<8 zo&}+=z6wHr`cn}4^PhuItrmp7{yGT#!yko$A7w&8=EtGn$3F=LKly1W`039=!Owmk3V!~}Q1HvQL&4hzLcxKfq2TD5 zP;ll_D7bVZ6x_HM3hq4(1y7%af@fcag0KD*3jXxxQ1ItkD5!lM3cmhJDEP}?L&0Bn zL&5HTDEQk9{S@5&a z&x4$zj5B~dzexYCLR~pr?^&9m7~jUA?FGHK7l5Kp$#S2X#n?HKijus$-hgaXI!L_C4%-*!QsSVc)~PhkXzG9`-%# zd)W7|?_uA=zK4Ae`yTc^?0eYvuZ%eGmH{_C4%-*!QsSVc)~PhkXzG9`-%#d)W7|?_uA=zK4Ae z`yTc^?0eYvu5Uk8q-^P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qneWjBApg-zg#D0(c9{WA^d+hhv@3G%wzsG)${T};0_IvF2*zd95W536KkNqC| zJ@$L-_t@{T-($bWevkbg`#tu1?Drh|9{W9qz8BhKzsG)${T};0_IvF2*zd95W536K zkNqC|J@$L-_t@{T-($bWevkbg`#tu1?DyF3vEO6A$9|9f9{W9OzsG)$y&3GW-($bW zevkbg`#tu1?DyF3vEO6A$9|9f9{WA^d+hhv@3G%wzsG)${T};0_IvF2*zd95W536K zkNqC|J@$L-y9;2=?%mh29_XPSX+@9qL{GJ0^DOHGQhj^i1pe zTwmx*ZRmIUy}nXOf6yQGFDmO_#lFM7!@k45!@k45!@k45!@k45!@k45!@k45!@k45 z!@k45!@k45!@k45!@k45!@k45!@k45!@k45W9>T*y%XxN@38N%@38N%@38N%@38N% z@38N%@38N%@38N%@38N%@38N%@38N%@38N%@38N%@38N%@38N%?^yeeuRSy9uvMgfFSViH>G%3dCH+Bv z)W4{#f7SmGdoPCUwL!f=C;NbXz}^dn1OfYieZW3oAF%JferxwNUb=q|Z1?Yq>0VP5 zu;v`zdkLUW%xfC-b4EAO~LSg zF}(levp0q36Yy%#{>MIGAFvPD2kZm(0sDY`z&>Cfun*V=>;v`z`+$AGK42fP57-Cn z1NH%Xzc=vP1pi|nu=jID_ot1&jsM_5@Zg~yX+@9qL{GJ None: "pal8rletrns.bmp", "rgb32bf-xbgr.bmp", "rgb32h52.bmp", + "rgba32h56.bmp", ] for f in get_files("q"): try: diff --git a/src/PIL/BmpImagePlugin.py b/src/PIL/BmpImagePlugin.py index dd8c06f4d..82a9c47db 100644 --- a/src/PIL/BmpImagePlugin.py +++ b/src/PIL/BmpImagePlugin.py @@ -53,7 +53,7 @@ def _accept(prefix: bytes) -> bool: def _dib_accept(prefix): - return i32(prefix) in [12, 40, 52, 64, 108, 124] + return i32(prefix) in [12, 40, 52, 56, 64, 108, 124] # ============================================================================= @@ -95,7 +95,7 @@ class BmpImageFile(ImageFile.ImageFile): # --------------------------------------------- Windows Bitmap v2 to v5 # v3, OS/2 v2, v4, v5 - elif file_info["header_size"] in (40, 52, 64, 108, 124): + elif file_info["header_size"] in (40, 52, 56, 64, 108, 124): file_info["y_flip"] = header_data[7] == 0xFF file_info["direction"] = 1 if file_info["y_flip"] else -1 file_info["width"] = i32(header_data, 0)