Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.11.1
-
None
-
Qt 5.11.1 on KDE neon 18.04
Description
I found an .ico file that could not be loaded using QImageReader. After investgating and comparing it to other .ico files I found that the "bits per pixel" for the icon was incorrect, stating a pixel depth of "3328" (instead of e.g. 32). The file uses embedded PNGs for the icons like is common since Vista.
QImageReader is able to correctly determin the imageCount of 7 but canRead returns false.
The heuristic code in question in ICOReader::canRead
&& (ikonDir.idEntries[0].wBitCount <= 32 || ikonDir.idType == 2) // Bits per pixel*/
fails with this particular file. Other applications like Windows Explorer, Gimp, Krita, are able to correctly open and display the file.
The bits per pixel should be infered from the embedded PNG file that retains its entire header when embedded into an ICO file.