Hi everyone,
I have 2 pictures, from the same phone, taken on the same day, one displays properly and the second displays rotated in most software. Files are available here: https://we.tl/t-tPMfbYX7lY
Looking at the metadata, IMG_2694 has tag QuickTime:Rotation=Rotate 90 CW, while IMG_2697.HEIC.
I tried to add the missing tag to IMG_2697.HEIC, but can't find a way to do so.
Any hint how I can do to fix the rotation of IMG_2697.HEIC ?
Thanks !
Nice evening,
Caro
Image orientation and HEIC files is a messy issue. Part of the problem is that they are based upon the MP4 format and another part is that image viewers don't read the EXIF data regarding orientation in such images.
Because they are based upon MP4 format, there are two tags that are related to the orientation. There's the Quicktime:Rotation and the Composite:Rotation. The first is found in the ItemPropertyContainer (https://exiftool.org/TagNames/QuickTime.html#ItemProp). Exiftool can edit this if it exists, but I don't think that exiftool can create the ItemPropertyContainer in order to add one. The Composite:Rotation, as a Composite tag (https://exiftool.org/TagNames/Composite.html), is based upon two other tags, the QuickTime:MatrixStructure and the QuickTime:HandlerType. When this tag is edited, exiftool actually edits the MatrixStructure. But exiftool cannot create a MatrixStructure if it doesn't exist.
This part is guesswork for me. I think that when the image is decoded, these tags automatically rotate the image. The image viewer itself doesn't do anything. This leads to a problem when it reads the EXIF:Orientation. The image viewer can't really know if the image has already been rotated or not.
Unfortunately, I can't really offer a solution. Exiftool doesn't have the ability to fix the problem file and I haven't dealt with HEIC files enough to know of another solution.
I should point out that HEIC uses a separate Rotation tag, and not MatrixStructure to indicate rotation of the image(s).
- Phil