summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qicoimageformat/icons
diff options
context:
space:
mode:
authorJohn Chadwick <john@jchw.io>2023-07-08 02:52:03 -0400
committerJohn Chadwick <john@jchw.io>2023-07-11 18:35:41 +0000
commit1079b537396fcf5cd6c50cc8af19b078a50cf547 (patch)
treea09581a1683c5f44d82b26223521ce04c87d54e5 /tests/auto/gui/image/qicoimageformat/icons
parent417878904b39b444632df18f7dd37bcb073c0467 (diff)
Fix transparency in 16 bit and 24 bit ico files
As a result of the fix for QTBUG-75214, Qt inadvertently no longer reads the AND mask that specifies transparency for 16-bit and 24-bit ico files. This is because it tries to detect 32-bit icons by checking icoAttrib.depth == 32, but icoAttrib.depth is set to the depth of the QImage, not the depth of the icon, and 32-bit QImage is used for all of the non-indexed cases (16-bit, 24-bit and 32-bit.) This commit instead uses icoAttrib.nbits, which should reliably determine whether or not the icon is 32-bit. This makes the behavior consistent with other ico reading software, including Windows. Also, adds a unit test that verifies correct behavior of icon masks, checking for both QTBUG-75214 and QTBUG-113319. Amends 1d128ed1dfbcf49453ada922e54381c37264fde5. Fixes: QTBUG-113319 Change-Id: I89ac86ff16054c8925fff6afc8c530fa737f8385 Pick-to: 6.6 6.5 6.2 5.15 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/auto/gui/image/qicoimageformat/icons')
-rw-r--r--tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.icobin0 -> 12862 bytes
-rw-r--r--tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.pngbin0 -> 3911 bytes
-rw-r--r--tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.icobin0 -> 16958 bytes
-rw-r--r--tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.pngbin0 -> 5536 bytes
4 files changed, 0 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.ico b/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.ico
new file mode 100644
index 0000000000..7e9cfa2414
--- /dev/null
+++ b/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.ico
Binary files differ
diff --git a/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.png b/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.png
new file mode 100644
index 0000000000..f0a19c05e3
--- /dev/null
+++ b/tests/auto/gui/image/qicoimageformat/icons/masked/24bpp.png
Binary files differ
diff --git a/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.ico b/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.ico
new file mode 100644
index 0000000000..a22248d76a
--- /dev/null
+++ b/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.ico
Binary files differ
diff --git a/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.png b/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.png
new file mode 100644
index 0000000000..a6ceac73fa
--- /dev/null
+++ b/tests/auto/gui/image/qicoimageformat/icons/masked/32bpp.png
Binary files differ