[Interest] QML Camera: resulting image is rotated

Alexander Ivash elderorb at gmail.com
Tue Dec 11 10:09:04 CET 2018


On Dec 11 2018, at 6:47 am, Artem Sidyakin <artem.sidyakin at qt.io> wrote:
> As far as I know, it is impossible to tell in which position the camera is before you actually see its viewfinder in VideoOutput :)
>
> In my case I had a camera upside-down, so 180 degree rotation. I managed it like this:
> property bool cameraUpsideDown: true
> Camera {
> id: camera
> metaData.orientation: cameraUpsideDown ? 180 : 0
> // ...
> }
>
> VideoOutput {
> orientation: cameraUpsideDown ? 180 : 0
> source: camera
> // ...
> }
>
> And then if you need to preview images made by this camera you can bind their orientation to EXIF values:
> Image {
> autoTransform: true
> // ...
> }
>

I think you understood correct, with a small difference: I need actual QImage in correct orientation, not just Image capable to show it properly.
For now I temporarily gave up searching right solution and instead of using 'onImageSaved' started using 'onImageCaptured' and then stealing QImage from Qt image cache. As I understand 'onImageCaptured' gives just a preview, but I haven't noticed any focus issues or resolution issues or other major issues (well, maybe there is something wrong with white balance) for preview image.
As for the metadata - I tried it before, but for some reasons metaData.orientation was 'undefined' in my case. I need to check on different device to be fully sure I can't trust metadata.
Regards, Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181211/26f9a880/attachment.html>


More information about the Interest mailing list