Bug; HEIC width and height wrong way round

Started by nneil, November 15, 2022, 02:44:06 AM

Previous topic - Next topic

nneil

Using ExifTool 12.50 (& 12.42 on Linux) the width and height of iPhone HEIC images always have the largest value as the width. So for vertical orientation files they are wrong:

$ exiftool 20221022_132527883_iOS.heic | egrep -i "width|height|orien|rotat"
Orientation                     : Rotate 90 CW
Exif Image Width                : 4032
Exif Image Height               : 3024
Image Width                     : 4032
Image Height                    : 3024
Rotation                        : 270

$ magick identify 20221022_132527883_iOS.heic
20221022_132527883_iOS.heic HEIC 3024x4032 3024x4032+0+0 8-bit sRGB 3.52217MiB 0.000u 0:00.002

I can email the sample if required.




StarGeek

Quote from: nneil on November 15, 2022, 02:44:06 AMUsing ExifTool 12.50 (& 12.42 on Linux) the width and height of iPhone HEIC images always have the largest value as the width. So for vertical orientation files they are wrong:

That is because the image data itself is horizontal. AFAIK, no camera actually records rotated images in portrait orientation.  Exiftool is giving you the actual data from the file.  It's up to the software used to display the image to rotate the image according to the Orientation.

This result is the same no matter the file type, jpeg, NEF, CR2, etc.  Though for all these, ImageMagick displays a greater width than height even when the Orientation is set to rotate 90/270.

I can't find a sample HEIC image on the web that is in portrait orientation and the limited testing I'm able to do here by changing Orientation with exiftool doesn't give the same results when I check with ImageMagick.  IM still shows a greater width no matter what orientation I set.

Also of note is the discrepancy between Orientation and Rotation in you output.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).