opengisch / QField

A simplified touch optimized interface for QGIS
http://www.qfield.org
GNU General Public License v2.0
804 stars 223 forks source link

Store (rounded) camera/tablet-orientation in EXIF-metadata using QFIELD-camera-function #5224

Open koenigherford opened 4 months ago

koenigherford commented 4 months ago

Describe the issue

As it's recommended in #5194 to use the QField-camera-function it will be great when QField-camera will detect the (rounded) camera-/tablet orientation (landscape format / portrait format) and store this information in the EXIF-"orientation-"metadata of the photo.

With this it will be avoided to rework the orientation-information manually and results of fieldwork can be viewed on computer in an auto-rotated/correct way.

Reproduction steps

Steps to reproduce the behavior: 1) Create a project within QGIS and a layer with another photo-attachment-child-layer 2) Configure syncronisation with QFieldSync (in my case: max image-attachment-size /(with or height) = 1600px 3) Export project to folder, copy it on mobile device 4) Collect some data with QField and some photo-attachments 5) Transfer data to computer and syncronize it with QFieldSync 6) Go to Windows-Explorer or other favourite image-viewer

Expected behavior

Expected: Photos taken in landscape-orientation are in rotated correctly (height is smaller than width) and photos taken in potrait-format are upright in viewer (height is larger than width)

Observed behavior

All photos are in potrait-format although taken in landscape-mode

Screenshots and GIFs

grafik

Desktop (please complete the following information)

Mobile (please complete the following information)

[If the problem happened with QFieldCloud, please add your username and project name.]

jermfCH commented 1 month ago

Hello,

Is anything being done to fix this bug? I'm having exactly the same problem, and it seems I'm not the only one (see: _https://www.reddit.com/r/QGIS/comments/1e5nd61/recording_photo_orientation_in_qfield/_)

So to summarize, I've been taking pictures with the built-in camera in qfield, and the Exif.Image.Orientation tag always returns 0 no matter what orientation the smartphone is in when taking the picture.

For your information: QField 3.3.10 / Qt 6.6.3 QGIS 3.34.7 on Windows 11 Smartphone Samsung A53 / Android 14 / One UI 6.1

nirvn commented 1 month ago

FYI, just tried this with QField 3.3.10 on a Pixel 6A using both the native camera as well as QField's own QML-based camera and the image orientation worked out perfectly fine for me:

image

On the native camera, pixel 6A's camera app was adding the proper orientation EXIF metadata while on the non native camera, the photo itself was rotated.

jermfCH commented 1 month ago

Very interesting. It seems that this problem only appears on Samsung devices. I'm going to do a test with an Android other than Samsung, but I don't have one available at the moment.