[Interest] QML Camera: resulting image is rotated

Alexander Ivash elderorb at gmail.com
Tue Dec 11 10:21:07 CET 2018

On Dec 11 2018, at 10:26 am, René Hansen <renehh at gmail.com> wrote:
> So far I haven't seen a case where the VideoOutput doesn't get the orientation correct on a Camera preview, but that's still only from a 5-10 different devices I've tested, (ios, android, mac). That's where I got the logic from in my original reply. Have a look at:
> https://github.com/qt/qtmultimedia/blob/5.11/src/qtmultimediaquicktools/qdeclarativevideooutput.cpp (https://link.getmailspring.com/link/1544519460.local-f95a2556-ae6e-v1.5.3-420ce003@getmailspring.com/0?redirect=https%3A%2F%2Fgithub.com%2Fqt%2Fqtmultimedia%2Fblob%2F5.11%2Fsrc%2Fqtmultimediaquicktools%2Fqdeclarativevideooutput.cpp&recipient=aW50ZXJlc3RAcXQtcHJvamVjdC5vcmc%3D)
Yeah, VideoOutput's orientation - is what I used in first attempt to 'un-rotate' resulting QImage from onImageSaved. But it turned out it works fine only on 2 devices from 4. (although all of them shows preview properly rotated!) Seems like actual rotation of resulting image can be calculated as 'rotation from auto-rotated VideoOutput' + 'some device-specific constant' (which for two devices was zero, for other two - maybe -90 or something). Unfortunately this 'device-specific constant' doesn't seem to be calculable from 'camera.orientation', 'Screen.nativeOrientation' (btw, why doesn't it exposed to QML ?), 'Screen.primaryOrientation' and 'Screen.orientation'.
p.s. I still need to try your original suggestion with taking orientation from 'mediaObject' / C++...
Regards, Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20181211/3271f75a/attachment.html>

More information about the Interest mailing list