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

HEIF image loaded with wrong orientation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3
    • Image formats
    • None
    • iPad 6th generation, iPadOS version 17.2
    • iOS/tvOS/watchOS

    Description

      From the Qt Maintenance Tool I added the additional library Qt Image Formats (version 6.5.3-0-202309260341) on my mac device to have support for HEIF images in iOS.

      With the following code I want to load a heif picture from my gallery, but when I select one in portrait mode it becomes rotated by 90° and by printing width and height I assume that there is a problem in reading/applying the orientation metadata.

      Here is my example code:

      const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
      const QString location = locations.isEmpty() ? "" : locations.last();
      const QString file = QFileDialog::getOpenFileName(nullptr, "Choose a picture", location, "Image files (*.heic *.HEIC *.heif *.HEIF)");
      QFile imageFile(file);
      if (imageFile.open(QIODevice::ReadOnly)) {
          const QImage image = QImage::fromData(imageFile.readAll());
          qDebug() << "Image width:" << image.width() << "- height:" << image.height();
      } 

       

       

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            alef Alessandro Florio
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes