Exiftool -orientation makes unknown changes to exif data

Started by arpaq10, June 16, 2022, 07:21:30 AM

Previous topic - Next topic

arpaq10

We have encountered an issue when rotating an image by changing image orientation tag (IFD0 Orientation) with exiftool. We have a requirement to be able to revert orientation to original value and be able to have the MD5 hash value to match the original image. When updating orientation with exiftool it seems like something else is being changed on the file which makes it impossible to get MD5 value to match the original image when orientation is reverted back to the original value. Does anyone have an idea what is causing this? Example below:

1. Original image info:
Orientation:
Orientation                     : Horizontal (normal)
Orientation                     : 1


MD5 Hash:
9ebbb021d037e79c501c722fb3a2ae03

2. Rotating the image 270 CW
exiftool -orientation#=8 image.jpg

Orientation:
Orientation                     : Rotate 270 CW
Orientation                     : 8


MD5 Hash:
d5f99b23ccd8e84e0c1c0fd65e7944fc

3. Reverting orientation to original Horizontal (Normal)
exiftool -orientation#=1 image.jpg

Orientation:
Orientation                     : Horizontal (normal)
Orientation                     : 1

MD5 Hash:
61c9ff15b190001dddd26551c6c46983 ==> MD5 value does not match the value from the first step.

Comparing step 1 and step 3 images with exiftool we can see changes on FileModifyDate, FileAccessDate and FileCreateDate. However as far as I know there should not impact the MD5 hash
exiftool -X image.jpg

<System:FileModifyDate>
<System:FileAccessDate>
<System:FileCreateDate>


Comparing images with ImageMagick we can detect some differences on exif-data.
magick identify -verbose image.jpg

Original image (from step 1)
Profile-exif: 480 bytes
exif:ExifOffset: 312
Filesize: 935639B

Reverted image (from step 3)
Profile-exif: 478 bytes
exif:ExifOffset: 322
Filesize: 935637B



4. Rotating image on Windows 10 > right click > rotate left/right makes it possible to revert back to original MD5 hash
Original Image:
Orientation                     : Horizontal (normal)
Orientation                     : 1


MD5 hash
9ebbb021d037e79c501c722fb3a2ae03

Rotating image left
Orientation                     : Rotate 270 CW
Orientation                     : 8


MD5 hash
66cdaecd7d27cb272ee21998f9f0b3bf

Rotating image back to original orientation:

Orientation                     : Horizontal (normal)
Orientation                     : 1

MD5 hash:
9ebbb021d037e79c501c722fb3a2ae03 ==> Image orientation and MD5 have been reverted back to original.




StarGeek

* 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).