Sony:Rotation does not get written

Started by perot, December 05, 2014, 12:13:13 PM

Previous topic - Next topic

perot

I'm trying to correct orientation information in some images taken with a Sony A900. I successfully had exiftool change the IFD0 and IFD1 tags "Orientation", but it fails with the "Rotation" tags in the Sony IFD. Using "-Sony:Rotation=normal" or "-Rotation=normal" on the command line gets accepted without warnings, but the erroneous tag values in the file (there seems to be two of them) do not get changed. This is with version 9.74, which is the latest I can get with Debian. Am I doing anything stupid?

On a different issue: I write GPS information into the file, with "-GPSLatitudeRef=S -GPSLatitude=<some positive float number>", and correspondingly for Longitude and Altitude. Displaying the changed file with exiftool I can see everything written as intended, but looking at the tags with Windows Explorer, the "Ref" information (N/S, W/E, above/below) is not displayed, just the unsigned coordinates are. Do I need to write any other tags into the file so that the References are also shown in Windows?

BTW.: Thanks for an awesome piece of software!

Cheers  Peter

Phil Harvey

Hi Peter,

You need to specify IFD1:Rotation if you want to change a tag in IFD1.  By default, ExifTool will only change IFD0 and ExifIFD tags.

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

perot

Hi Phil,

thanks for your reply. Using your suggestion gives me the warning that "Tag 'IFD1:Rotation' does not exist". I did not really expect anything different; as I wrote I managed to change both "IFD0:Orientation" and "IFD1:Orientation". Both "Rotation" tags however are listed under the "Sony" IFD, that's why I tried "-Sony:Rotation=normal", which does not give me any warning, but it does not have any effect either.

Cheers  Peter

Phil Harvey

Sorry, I don't have a lot of time recently and I skimmed your post too quickly.

This time I tried it with a D800 image, and this is what I got with the current version of ExifTool:

> exiftool a.jpg -rotation -a -G1
[Sony]          Rotation                        : Rotate 270 CW
[Sony]          Rotation                        : Rotate 270 CW

> exiftool a.jpg -rotation=normal
    1 image files updated

> exiftool a.jpg -rotation -a -G1
[Sony]          Rotation                        : Horizontal (normal)
[Sony]          Rotation                        : Horizontal (normal)


It sounds like you don't get this result.  I get the same result with ExifTool 9.74.

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

perot

Hmm, this is very interesting. If I do it exactly like you do, it works. So a workaround would be to do the work with two calls to exiftool.
At first I thought the problem is that I capitalised the tag like you document them on the website, but in your example it is lower case. But even if I use exactly the same writing in my command line it does not work. So I feel I need to give more info here.
What happens is that the workflow of processing a picture with two to four software tools messes up the meta information. Every tool drops a fair number of tags, while every one of them feels the need to litter the exif with "Kilroy was here" (replace Kilroy with software name). So what I do is I have the camera store raw and jpeg versions, and I want to use exiftool to scrap the messed-up meta information, copy from the original jpeg and fix a few minor things on the way. I got it mostly working, except for the two issues described in the top posting. So I use exiftool in a script, called by

exiftool -overwrite_original                                                           \
         -all=                                                                                     \
         -tagsfromfile ${original}                                                      \
         -all:all -unsafe                                                                      \
         -IFD0:Orientation=normal                                                    \
         -IFD1:Orientation=normal                                                    \
         -Sony:Rotation=normal                                                        \
         -Artist="Peter Rottengatter"                                                \
         -Copyright="Peter Rottengatter"                                         \
         -LensModel="${lens}"                                                         \
         -XMP-microsoft:LensModel="${lens}"                                  \
         -XMP-microsoft:LensManufacturer="${lensmake}"              \
         -TimeZoneOffset=0                                                               \
         -GPSLatitudeRef=S -GPSLatitude=17.407056                       \
         -GPSLongitudeRef=E -GPSLongitude=124.946694                \
         -GPSAltitudeRef=above -GPSAltitude=42                               \
         ${processed}

Except for the "Rotation" option all the options do what they're supposed to do. I have tried
         -Sony:Rotation=normal                                       # accepted but does nothing
         -Rotation=normal                                                # accepted but does nothing
         -Sony:rotation=normal                                        # accepted but does nothing
         -rotation=normal                                                 # accepted but does nothing
         -Sony:Rotation=0                                                # gives warning (does nothing)
         -Rotation=0                                                         # gives warning (does nothing)

If I try it as the only operation in the call to exiftool (like your example) it works.
Puzzled.

Cheers  Peter

Phil Harvey

Hi Peter,

The maker notes are copied as a block, so they may not be edited in the same step.  You must first copy them, then edit them with a separate command (or use the -execute feature).

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

perot

That explains my problems. Thanks for the information. Is that documented somewhere? I thought I had read the docs fairly thoroughly. Still may have missed it of course.

I now use

exiftool -overwrite_original                                                           \
         -all=                                                                                     \
         -tagsfromfile ${original}                                                      \
         -all:all -unsafe                                                                      \
         -IFD0:Orientation=normal                                                    \
         -IFD1:Orientation=normal                                                    \
         -Artist="Peter Rottengatter"                                                \
         -Copyright="Peter Rottengatter"                                         \
         -LensModel="${lens}"                                                         \
         -XMP-microsoft:LensModel="${lens}"                                  \
         -XMP-microsoft:LensManufacturer="${lensmake}"              \
         -TimeZoneOffset=0                                                               \
         -GPSLatitudeRef=S -GPSLatitude=17.407056                       \
         -GPSLongitudeRef=E -GPSLongitude=124.946694                \
         -GPSAltitudeRef=above -GPSAltitude=42                               \
         ${processed}                                                                        \
         -execute                                                                                 \
         -Rotation=normal                                                                   \
         ${processed}

which does the job. Judging from the speed though, it seems to copy the whole image data (32MB here) twice now, where all that I want is to have it modified in place with possibly no copying of image data at all. Does exiftool provide a more efficient way of doing it?

My GEO-tag problem described in the top posting is not solved yet. I'll open a new thread for it.

Cheers  Peter

Phil Harvey

Yes, it will have to copy the entire file twice.  You could go through an intermediate metadata file to only write the image file once, but that probably won't save any time since it adds another step (although the metadata file would be smaller).

So I can't suggest any alternative.

You're right, I don't think this restriction is documented.  It is mentioned in the documentation a number of times that the makernotes are copied as a block, but I can't find anywhere where it says that you can't modify the blocks as they are being copied.  However, this is true for any metadata copied as a block.  I'll see if I can add this to the documentation somewhere.

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

Phil Harvey

Quote from: Phil Harvey on December 09, 2014, 01:49:45 PM
It is mentioned in the documentation a number of times that the makernotes are copied as a block, but I can't find anywhere where it says that you can't modify the blocks as they are being copied.

I found it in the -tagsFromFile documentation, note 3:

            3) The maker note information is copied as a block, so it isn't
            affected like other information by subsequent tag assignments on
            the command line.
[...]

I should have been able to find this... must get getting slow in my old age.

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