Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-70812

Fails to detect ICO file with PNG but incorrect bits per pixel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.11.1
    • Image formats
    • None
    • Qt 5.11.1 on KDE neon 18.04
    • Linux/X11

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            broulik Kai Uwe Broulik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes