QImageReader/ICOReader does not read the AND mask for 24bpp icon entries in .ico files, causing some icons to have opaque pixels that are supposed to be transparent. Qt uses the same codepath for 32-bit icons as it does 24-bit icons, because icoAttrib.depth is folded to 32 for 16, 24 and 32-bit icons.
The logic is here:
I think that icoAttrib.depth == 32 should possibly be icoAttrib.nbits == 32. This would still use the alpha channel when it is available, but otherwise, it will correctly read the mask.
Attached is an example of an icon with such a problem, extracted from a program called HookShark. It works with most other software that reads .ico files, including GIMP, and I believe most (all?) versions of Windows that support 24bpp icons.
|For Gerrit Dashboard: QTBUG-113319|
|490729,1||Fix transparency in 16 bit and 24 bit ico files||tqtc/lts-6.2||qt/tqtc-qtbase||Status: NEW||+2||0|
|490250,7||Fix transparency in 16 bit and 24 bit ico files||dev||qt/qtbase||Status: MERGED||+2||0|
|490727,2||Fix transparency in 16 bit and 24 bit ico files||6.5||qt/qtbase||Status: MERGED||+2||0|
|490728,2||Fix transparency in 16 bit and 24 bit ico files||6.6||qt/qtbase||Status: MERGED||+2||0|
|490730,2||Fix transparency in 16 bit and 24 bit ico files||tqtc/lts-5.15||qt/tqtc-qtbase||Status: MERGED||+2||0|