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

QImageReader::imageFormat(const QString &) cannot autodetect image format

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.5
    • Image formats
    • None
    • Windows 7 64-bit

    Description

      I have a file 1.jpg.
      I rename it to 1.bmp.
      QImageReader::imageFormat(file) will return an empty QByteArray.

      That's because:
      In function createReadHandlerHelper() in file "qimagereader.cpp"
      From line 308 to line 319
      It will use keys.at(i) to create QImageIOPlugin.
      However, while testing whether the plugin can read, it use testFormat rather than keys.at(i)

      If I change testFormat from "bmp" to "jpg" while debuging, the desired result will be returned.

      Besides, keys won't contain "png" and "bmp" which make it cannot autodetect those formats.

      Attachments

        1. 1.bmp
          3 kB
        2. autodetectTestProject.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            likwueron Li, Kwue-Ron
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes