Image rotation

I am trying to correct image rotations (portrait or landscape) when displayed in a report back in the office using QGIS
I found some very useful reading in this post
We are using Ipads
I have disabled “use native camera” so I now get tagged photos
I can get a map of the exif data using exif(project_folder + '/' + "Photo2")
The Exif.Image.Orientation tag is always set to 6 (6 = Rotate 90 CW) regardless of the orientation when the photo was taken - from my testing
Any ideas why the orientation is always 6 ?
is there another way?

Map of my exif tags

 'Exif.GPSInfo.GPSAltitude': 9999999
 'Exif.GPSInfo.GPSAltitudeRef': 1
 'Exif.GPSInfo.GPSDateStamp': <date: 2024-08-01>
 'Exif.GPSInfo.GPSImgDirection': 183.039948
 'Exif.GPSInfo.GPSImgDirectionRef': 'M'
 'Exif.GPSInfo.GPSLatitude': 99999999
 'Exif.GPSInfo.GPSLatitudeRef': 'N'
 'Exif.GPSInfo.GPSLongitude': 9999999999
 'Exif.GPSInfo.GPSLongitudeRef': 'W'
 'Exif.GPSInfo.GPSSatellites': '00'
 'Exif.GPSInfo.GPSTimeStamp': <time: 10:52:32>
 'Exif.Image.DateTime': <datetime: 2024-08-01 11:52:36 (GMT Daylight Time)>
 'Exif.Image.ExifTag': 230
 'Exif.Image.GPSTag': 2100
 'Exif.Image.HostComputer': 'iPad mini'
 'Exif.Image.Make': 'QField'
 'Exif.Image.Model': 'iPad mini'
 'Exif.Image.Orientation': 6
 'Exif.Image.ResolutionUnit': 2
 'Exif.Image.Software': '16.1.1'
 'Exif.Image.XResolution': 72
 'Exif.Image.YCbCrPositioning': 1
 'Exif.Image.YResolution': 72
 'Exif.Photo.0x9010': '+01:00'
 'Exif.Photo.0x9011': '+01:00'
 'Exif.Photo.0x9012': '+01:00'
 'Exif.Photo.0xa460': 2
 'Exif.Photo.ApertureValue': 1.695994
 'Exif.Photo.BrightnessValue': 2.525702
 'Exif.Photo.ColorSpace': 1
 'Exif.Photo.ComponentsConfiguration': '1 2 3 0'
 'Exif.Photo.DateTimeDigitized': <datetime: 2024-08-01 11:52:36 (GMT Daylight Time)>
 'Exif.Photo.DateTimeOriginal': <datetime: 2024-08-01 11:52:36 (GMT Daylight Time)>
 'Exif.Photo.ExifVersion': '48 50 51 50'
 'Exif.Photo.ExposureBiasValue': 0
 'Exif.Photo.ExposureMode': 0
 'Exif.Photo.ExposureProgram': 2
 'Exif.Photo.ExposureTime': 0.02
 'Exif.Photo.FNumber': 1.8
 'Exif.Photo.Flash': 16
 'Exif.Photo.FlashpixVersion': '48 49 48 48'
 'Exif.Photo.FocalLength': 3
 'Exif.Photo.FocalLengthIn35mmFilm': 29
 'Exif.Photo.ISOSpeedRatings': 125
 'Exif.Photo.LensMake': 'Apple'
 'Exif.Photo.LensModel': 'iPad mini back camera 3mm f/1.8'
 'Exif.Photo.LensSpecification': '3/1 3/1 9/5 9/5'
 'Exif.Photo.MakerNote': '65 112 112 108 101 32 105 79 83 0 0 1 77 77 0 39 0 1 0 9 0 0…'
 'Exif.Photo.MeteringMode': 5
 'Exif.Photo.PixelXDimension': 4032
 'Exif.Photo.PixelYDimension': 3024
 'Exif.Photo.SceneCaptureType': 0
 'Exif.Photo.SceneType': '1'
 'Exif.Photo.SensingMethod': 2
 'Exif.Photo.ShutterSpeedValue': 5.643929
 'Exif.Photo.SubSecTimeDigitized': '598'
 'Exif.Photo.SubSecTimeOriginal': '598'
 'Exif.Photo.SubjectArea': 2013
 'Exif.Photo.WhiteBalance':

Imported from GitHub discussion by @BTreeTech on 2024-08-01T11:58:04Z

According to this link 6 means photos taken in portrait mode with iOS. It means “rotate 90 CW” is from a landscape by default.
You don’t tell us if your photos have been taken with different orientation or not, resulting with only this “6” orientation or if all the photos are just mis-oriented (landscape instead of portrait), which could mean you have to make a formula to change this 6 to 1 (exif.Photo.Orientation minus 5 for example).


Imported from GitHub comment by @VxTedxV on 2024-08-01T14:17:43Z

The Exif.Image.Orientation tag is always set to 6 (6 = Rotate 90 CW) regardless of the orientation when the photo was taken - from my testing

  • I tested with various photos taken in different orientations

Imported from GitHub comment by @BTreeTech on 2024-08-01T14:21:54Z

Do you confirm it’s not QField related then ? Your device always produces EXIF tags with this ‘6’ orientation, even when photos taken outside QField ?


Imported from GitHub comment by @VxTedxV on 2024-08-01T14:28:07Z

I haven’t tested photos taken outside of QField, I need it to work with photos taken in QField using the QField camera. I think the native camera doesn’t tag photos with much.


Imported from GitHub comment by @BTreeTech on 2024-08-01T14:32:30Z


Image of some of my testing.
I also tested on Android and the rotation is always 0, again using the QField camera


Imported from GitHub comment by @BTreeTech on 2024-08-01T14:53:40Z

Upstream issues.

For Android, it was fixed (Loading...) and will be part of QField 3.4

For iOS, follow this issue: Loading...


Imported from GitHub comment by @nirvn on 2024-08-01T15:40:59Z

nirvn thanks for the clarification, my original discussion does ask for ideas on other ways of making it work so not sure why this was changed to a bug and closed


Imported from GitHub comment by @BTreeTech on 2024-08-05T07:03:06Z

BTreeTech , I doubt there’s much of a workaround here. In the meantime, did you try a development build that will become QField 3.4 to see if the problem is indeed addressed as per upstream reporting? You could give the APKs here (Implement in-place processing for non feature-based algorithms by nirvn · Pull Request #5514 · opengisch/QField · GitHub) a try on an Android phone.


Imported from GitHub comment by @nirvn on 2024-08-05T07:06:10Z