Rotation issue

Started by __Caro__, February 18, 2025, 01:44:02 PM

Previous topic - Next topic

__Caro__

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

StarGeek

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. 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, 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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

I should point out that HEIC uses a separate Rotation tag, and not MatrixStructure to indicate rotation of the image(s).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).