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

QML Camera wrong Orientation on iOS

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • edc6d2548 (dev), 53b6f0ea1 (6.8), 14ae9465a (6.7), 00cb4080b (tqtc/lts-6.5), 9e30bf891 (dev), 71732008a (6.8.0), f2660feab (6.8), 743b7d109 (dev), 61d909002 (6.8)
    • Multimedia wk 31-32, Multimedia wk 35-38, Multimedia wk 39-40, Multimedia wk 41-42, Multimedia wk 43-44

    Description

      there are 2 different problems with wrong or lost Orientation.

      1. Wrong Orientation from captured Image on iOS

      The Image from ImageCapture: onPreviewChanged() looks good, but then the Image getting from ImageCapture: onImageSaved() sometimes is wrong: per ex.

      • Portrait Back Camera: OK
      • Landscape Back Camera: wrong
      • Portrait Front Camera: OK
      • Landscape Front Camera: wrong

      2. Lost Orientation when Scaling Images on iOS

      Some customers want to scale down Images before uploading to server. This works well on Android, but on iOS the Orientation gets lost, so even the Portrait Images then will have wrong orientation. This is what I’m doing to scale down:

       

      QImage capturedImage = QImage::fromData(capturedFile.readAll(), "JPG");
      capturedImage = capturedImage.scaledToHeight(maxSize);
      capturedImage.save(destinationFileName); 

      Copying the file without QImage::fromData() works – Orientation remains:

      QFile::copy(capturedPath, destinationFileName); 

      WORKAROUND: no comfortable workaround for customers: they have to inspect the Image after scaling and copy/save and do rotatation before uploading to server.

      ...and there's a new bug: Opening the QML Camera Example with 6.8.0 the orientation is wrong from the beginning.

      Attachments

        1. PhotoPreview.qml
          2 kB
          Ekkehard
        2. declarative-camera.qml
          5 kB
          Ekkehard
        3. iphone_se_portrait.png
          1.50 MB
          Ekkehard
        For Gerrit Dashboard: QTBUG-118594
        # Subject Branch Project Status CR V

        Activity

          People

            npskalerud Nils Petter Skålerud
            ekkescorner Ekkehard
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: