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

QImage not loading simple heic file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.7.3, 6.8.0 RC, 6.9.0 FF
    • 6.7.2, 6.8.0 Beta1
    • Image formats
    • None
    • MacOS Sonoma 14.5
    • macOS
    • 929698e7f (dev), 3158a940d (6.8), 321566cf1 (6.7)

      Qt 6.7.2 works for most heic files, but not the basic version attached.  Prior Qt versions do work.

      Minimal test example (files included):

      minimalimageviewer.pro

       

      QT = core widgets
      SOURCES += main.cpp 

      main.cpp

       

      #include <QtWidgets/QtWidgets>
      int main(int argc, char *argv[]) {
          QApplication app(argc, argv);
          QString path = "/Users/roryhill/Pictures/_ThumbTest/notworking/Heic1.heic";
          QImage image(path);
          QLabel label;
          if (image.isNull()) {
               label.setText("Failed to load " + path);                                  
               label.setFixedSize(QSize(800, 200));
          }
          else {
               label.setPixmap(QPixmap::fromImage(image));                                
               label.setFixedSize(image.size());
          }
          QString qtVersion = QT_VERSION_STR;
          label.setWindowTitle("HEIC Image Viewer    Qt Version " + qtVersion);
          label.setAlignment(Qt::AlignCenter);
          label.show();
          return app.exec();
      } 

       

      SAMPLE OUTPUT: 1st from Qt 6.7.1, then Qt 6.7.2

        1. 1.png
          1.33 MB
          Rory Hill
        2. 2.png
          54 kB
          Rory Hill
        3. Heic1.heic
          873 kB
          Rory Hill
        4. main.cpp
          0.7 kB
          Rory Hill
        5. MinimalImageViewer.pro
          0.0 kB
          Rory Hill
        For Gerrit Dashboard: QTBUG-127965
        # Subject Branch Project Status CR V

            vgt Eirik Aavitsland
            rory Rory Hill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes