The documentation in exiftool_pod.pdf and in https://exiftool.org/TagNames/index.html does not describe the -Orientation tag and its options. Could you please tell me where to look for information? If I rotate an image will the orientation by 90 degrees will the orientation tag also change and will the vertical and horizontal values be switched? Thanks
Quote from: spruce18b on November 14, 2011, 04:32:48 PM
If I rotate an image will the orientation by 90 degrees will the orientation tag also change and will the vertical and horizontal values be switched? Thanks
Yes and no. It depends on the software.
Most image editing software will rotate the JPEG image and set the Orientation to Horizontal. But it is also possible to leave the JPEG image alone and change only the Orientation tag. See the EXIF specification (http://www.cipa.jp/english/hyoujunka/kikaku/pdf/DC-008-2010_E.pdf) for details.
- Phil
I clicked on EXIF specification (DC-008-2010_E.pdf) and searched for "-orientation" and found only one mention on p. 181 of DC-008-2010_E.pdf with no details of the options for the -orientation tag.
The Orientation tag is described on pages 30-35 of this document (in rather excruciating detail).
- Phil
Thanks for your quick response. Excruciating, yes. All I am looking for is a summary of the main -orientation options like
> exiftool -Orientation -S a.jpg
as shown on p. 10 of exiftool_pod.pdf.
For example, if CW stands for clockwise, is there counterclockwise? What does -S mean for -orientation? Please tell me where to find a list of all the options for -orientation. Thanks.
OK, then I am confused because you started this thread by referring to the tag name documentation (https://exiftool.org/TagNames/index.html). This table of valid string values for the Orientation tag is given in the EXIF section of this 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
It sounds like this is what you are asking for.
The -S option in the command you mentioned just prints the tag name instead of the description and avoids extra spaces in the output (as described at the bottom of page 11 in the application PDF documentation). It applies to all tags when extracting information. In the case of the Orientation tag, the description and the tag name are identical so the -S only removes extra spaces before the colon.
- Phil
C:\DATA\Pictures\SAmerica2011\Reduced>c:\batch\exif\rotate01.bat
C:\DATA\Pictures\SAmerica2011\Reduced>c:\apps\exiftool\exiftool.exe -orientatio
n=8 TempRotateDSC03313.JPG
1 image files updated
I rotated the attached image with the code shown above but it did not appear rotated as expected. The original is unrotated when viewed as a thumbnail and with the HTML code shown below, but it is rotated when I view it with Irfan.
Thanks
<tr><td>
<a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=-0.900043056,-89.61081806 &aq=&ie=UTF8&t=f&z=16&vpsrc=0&ecpose=-0.900043056,-89.61081806 ,1025.22,0,0,0"> <img src=DSC03313.JPG width="600 " height="337.5 "></a></td></tr><tr>
<td width="600 " style="color:blue">Caption:DSC03313.JPG <br/><br/></td><td width="600 "allign="right"> 17 <br/><br/></td></tr>
To change the orientation of the thumbnail, write IFD1:Orientation. Writing Orientation without specifying a location will set the orientation of the main image only.
Whether or not this EXIF Orientation information is honoured depends on the software, as you have discovered. If you want something that works will all software you need to actually rotate the image data and set Orientation to Horizontal, but you can't do this with ExifTool because it can't be used to modify the image data.
- Phil
Hi Phile, Please tell me how to change the command below with the IFD1:Orientation option:
c:\apps\exiftool\exiftool.exe -orientation=8 TempRotateDSC03313.JPG
Thanks
Hi Phil, Sorry about misspelling your name.
Hi,
I think Phil ment something like:
c:\apps\exiftool\exiftool.exe -IFD1:Orientation#=8 TempRotateDSC03313.JPG
Bogdan
Quote from: BogdanH on November 17, 2011, 04:34:13 PM
I think Phil ment something like:
c:\apps\exiftool\exiftool.exe -IFD1:Orientation#=8 TempRotateDSC03313.JPG
Exactly. You can set both this and the normal (IFD0) Orientation tag with the same command. The "#" that Bogdan has used on the tag name is explained in FAQ number 6 (https://exiftool.org/faq.html#Q6).
- Phil
Hi BogdanH and Phil, Thank you for staying with me on this.
I rotated an image with the following command:
C:\DATA\Pictures\SAmerica2011\Reduced\temp>c:\apps\exiftool\exiftool.exe -IFD1:Orientation#=8 DSC03479.JPG
1 image files updated
The photograph (attached) of marine tortoise sand tracks appears in portrait orientation when viewed in Irfan but it is in landscape orientation when viewed with the HTML attached document both before and after rotation with the above command. The picture should be in portrait orientation when viewed with the HTML document.
Could you please tell me what I am doing wrong?
Thanks
Thanks.
I didn't pay attention that you mentioned showing correct oriented image in html...
First, your attached original jpg has correct Orientation tag value, so there's no need to change anything in this regard.
I'm using quite old Firefox browser, but as far I know (I'm not expert on this), there's no browser which would automatically rotate image according to Exif:Orientation value. If you see somewhere that images are automatically rotated, then (I believe) that's achieved by using some script code on server -that is: image is rotated (according to Orientation value) before it is sent to your browser.
So, I suggest you simply phisically rotate images which you wish to show in your html pages.
Bogdan
Hi Bogdan, Thanks for the response. If I understand your answer correctly, you are saying that I cannot expect a browser to respect rotation settings created from EXIF commands. If that is the case, then in what situations will EXIF rotation commands such as,
c:\apps\exiftool\exiftool.exe -IFD1:Orientation#=8 DSC03479.JPG
be useful?
Quote from: Phil Harvey on November 16, 2011, 05:56:37 PM
Whether or not this EXIF Orientation information is honoured depends on the software
Typically, this is the way images are orientated when they come out of a camera, so any software which typically deals with images from cameras should honour the EXIF Orientation. And it appears that web browsers do not. Other than that, your guess is as good as mine.
- Phil
Since a few days I am testing a bit with rotation information. I found out that there are cameras which save the picture always in landscape (4000x3000) and set the orientation tag to rotate the image and there are cameras which save the picture in portrait or landscape and set the orientation tag always to horizontale.
I let the pictures from my camera in landscape even if they are a portrait and let my software use the orientation tag in the Exif information. That is because I will not edit every picture from my camera.
But for some cameras which did not save the picture in the right alignment and set no orientation tag Phil said in another thread which software he use to loosless rotate the image. Was this for OSX also? Which software was it. I can't find the Thread again?
All of the cameras I own set the Orientation tag and don't rotate the image data. If they did rotate the image data then I wouldn't need to do the lossless rotation. I use jpegtran on OS X to do the rotation. It is a command-line utility that you can download for any unix-based system.
- Phil