Changing duplicate values

Started by Alan Clifford, December 11, 2012, 12:24:54 PM

Previous topic - Next topic

Alan Clifford

Something interesting came up but first the question.  If I put a "-a" in this script line

exiftool -orientation="1" -n -s -s -s -q -overwrite_original_in_place "${UFN}"

would it change both values  in the photo instead of just one

alan@tenesmus:~/temp$ exiftool -a -G -orientation -imagesize dscf0178.jpg
[EXIF]          Orientation                     : Horizontal (normal)
[EXIF]          Orientation                     : Rotate 90 CW
[Composite]     Image Size                      : 768x1024
a


The interesting bit is that I have just been given an old iphone.  When I looked at the page with the photo, which has been physically rotated to be portrait,  http://f16.eu/potpourri/tn/dscf0178.jpg.index.html, the browser rotated the photo on the web page.

This is the only photo on my website with a newish camera, a Fuji F500.  As this photo went on to win me an HS30, I've checked photos from that camera and they have two orientation entries as well.  I've yet to check my old photos from previous Fuji cameras.

Alan


Phil Harvey

#1
Hi Alan,

The -a option has no effect when writing.  ExifTool should update both Orientation tags without it.

Browsers are not very consistent in their use of EXIF Orientation.  I believe that the current version of Safari does honour this tag, but I know that older versions did not.

- Phil

Edit:  I think I was wrong about ExifTool changing both Orientation values.  If one exists in IFD1, it will not be changed unless IFD1:Orientation is specified.  This is the orientation of the embedded thumbnail, and not the image itself.  Add the -v2 option to the write command to see what tags ExifTool will write, and add the -G1 option when reading to see where the existing tags are located.
...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 ($).

Alan Clifford

Phil, the second one is an IFD1.  But I think the problem might be me.

I have investigated further.  Although the largest photo on the website has the IFD0 orientation set to 1, the smaller photos derived from it have a rotate 90.  This could be me only updating the largest photo at a later date or it could be the website creating program which ultimately uses imagemagick I think.  If I were laying a bet, I would say it was me  :)

Still, I still found it interesting that the iphone's safari is using the orientation tag and something to watch out for.

Alan Clifford

I lost my bet with myself.  In the process of generating smaller photos, "Album" changes the orientation tag somehow.  Still could be me with snippets of Perl I've added but I don't think so  :(

alan@malander:potpourri$ exiftool -a -G1 -orientation dscf0178.jpg
[IFD0]          Orientation                     : Horizontal (normal)
[IFD1]          Orientation                     : Rotate 90 CW
alan@malander:potpourri$ exiftool -a -G1 -orientation tn/dscf0178.med.jpg
[IFD0]          Orientation                     : Rotate 90 CW
[IFD1]          Orientation                     : Rotate 90 CW
a


Alan Clifford

Bit of a bug in the website generating software.  I removed the IFD1 value and the regenerated smaller photos didn't have erroneous value in IFD0.

Exiftool makes this all possible.  Thanks Phil.

Alan

Phil Harvey

Hi Alan,

Great, glad to hear you found a solution.

- 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 ($).