Writing to the EXIF:Orientation Tag

Started by Paul Barrett, December 18, 2016, 07:01:25 PM

Previous topic - Next topic

Paul Barrett

I was troubleshooting an issue with an app that did not appear to be writing an orientation tag to the EXIF:Orientation field, which meant that rotating the image in that app was not reflected in another app.

I forced a value into the field using:

c:\windows\exiftool\exiftool "-Orientation=Vertical" "\\nas02\photo\Pictures\Scans\IMG_20161217_0001.jpg" -m -P -overwrite_original

But when I examined the metadata the value of that field had changed to "Mirror vertical"

Previously the value was "Rotate 180"

To my untutored eye it looks though some kind of relative adjustment was done, rather than an absolute one.  Is that correct?  If so what syntax should I use to achieve 90 degree orientation changes please?  If it's not that can you tell me what the explanation is please?

Thanks for your help with this.

Regards


Paul Barrett

StarGeek

Normally, you'll want to set Orientation to one of these:
Horizontal (normal)
Rotate 90 CW
Rotate 180 CW
Rotate 270 CW

Those are the simple rotations settings.  But the exif standard also allows the image to be mirrored.  Exiftool is flexible on what you enter and tries to figure out what you want to set.  When you use "vertical", it thinks you want "Mirror vertical".

QuoteIf so what syntax should I use to achieve 90 degree orientation changes please?

You'll probably want to use either -orientation="Rotate 90 CW" or -orientation="Rotate 270 CW" depending upon how the camera was originally held in the first place.

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

Alan Clifford

I prefer using numbers

-orientation#=6

From exiftool documentation

1 = Horizontal (normal)
2 = Mirror horizontal
3 = Rotate 180
4 = Mirror vertical
5 = Mirror horizontal and rotate 270 CW
6 = Rotate 90 CW
7 = Mirror horizontal and rotate 90 CW
8 = Rotate 270 CW

Paul Barrett


StarGeek

Quote from: Alan Clifford on December 18, 2016, 08:29:17 PM
I prefer using numbers

Often, I would like to use the numbers, but it annoys me that it's not a simple sequence for simple rotation.  You have to remember 1, 6, 3, 8 to rotate through 360 degrees. 

But then, I usually use Irfanview's JpegTran plugin just to automatically rotate to normal orientation and not bother otherwise.
* 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).