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

QML ImageCapture preview property does nothing?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 6.2.0
    • Fix Version/s: 6.2.1, 6.2, 6.3.0 Alpha
    • Component/s: Multimedia
    • Labels:
      None
    • Environment:
      Windows 10 20H2 Build 19042.1288

      Description

      I took the example from: https://doc.qt.io/qt-6/qml-qtmultimedia-imagecapture.html

      I modified it a little bit to get it running:

      import QtQuick
      import QtQuick.Window
      import QtMultimedia
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 720
          visible: true
          CaptureSession {
              imageCapture : ImageCapture {
                  id: imageCapture
                  onImageCaptured: function( id, preview ){
                      console.log( "Image captured: >" + preview + "<" )
                  }
              }
              camera: Camera {
                  id: camera
              }
      
              videoOutput: videoOutput
          }
          VideoOutput {
              id: videoOutput
              anchors.top: parent.top
              anchors.left: parent.left
              anchors.right: parent.right
              height: parent.height / 2
          }
          Image {
              id: photoPreview
              anchors.top: videoOutput.bottom
              anchors.bottom: parent.bottom
              anchors.left: parent.left
              anchors.right: parent.right
              source: imageCapture.preview // always shows the last captured image
          }
          Button{
              text: "Capture"
              anchors.left: parent.left
              anchors.bottom: parent.bottom
              onClicked: imageCapture.capture()
          }
          Button{
              text: "Check whats in imageCapture.preview"
              anchors.right: parent.right
              anchors.bottom: parent.bottom
              onClicked: console.log( "imageCapture.preview >" + imageCapture.preview + "<" )
          }
      
          Component.onCompleted: camera.start()
      }
      
      1. Open the app
      2. Push button "Capture"
      3. onImageCaptured is called with an image
      4. photoPreview does not show an image
      5. Push button "Check whats in imageCapture.preview" logs to console - imageCapture.preview seems empty

       

      So now I am not certain if the example is just wrong or something is broken.

       

      Also the type for preview is documented wrong (I guess):

        Attachments

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

          Activity

            People

            Assignee:
            piotr Piotr Srebrny
            Reporter:
            Marscho Marscho
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes