Sony DSC-HX20V - GPS Bug in EXIF (tag "direction")

Started by Vincent, October 06, 2012, 11:29:33 AM

Previous topic - Next topic

Vincent

Hello,

I'm a french user and i bought a Sony DXC-HX20V with GPS. This camera store in EXIF tag position and orientation information.
When l view my picture on Geosetter, the orientation of them are wrong (an offset of 90 degree !)
I see Sony Faq and i see they produce a new firmware release that fix the bug.
But I want to fix picture they whas produce whith "old firmware".
Can I use Exiftool to modify my 996 pictures for applicate an négative offset of 90 degrees ???
What's the command line ?

Thank's.

Excuse for my english ...

Phil Harvey

#1
You can do this with a user-defined tag and a command like this:

exiftool "-gpsimgdirection<mydirection" FILE

where FILE is the name of your image file, and MyDirection is a user-defined tag similar to the MyTilt tag in this post.

See the sample config file for instructions on activating the config file for the user-defined tag.

- Phil

Edit: Fixed errant quote in exiftool command
...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 ($).

Vincent

Ok, thanks for your help.
I try it on a picture and it's works.

For angry Sony user, modify .ExifTool_config and add this :

    'Image::ExifTool::Composite' => {
        MyDirection => {
            Require => 'GPSImgDirection',
            ValueConv => '$val - 90',
        },
    },

and then, write on command line tool :

exiftool "-GPSImgDirection<MyDirection" FILE

Enjoy.

Thanks.

Phil Harvey

Another user just reminded me that ExifTool's increment feature may also be used to do this:

exiftool -gpsimgdirection+=-90 FILE

However, this may result in negative numbers, which could be corrected like this:

exiftool -gpsimgdirection+=360 if '$gpsimgdirection < 0' FILE

Where FILE is one or more directory and/or file names.  Note that the quotes above are for Mac/Linux.  In Windows use double quotes instead.

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

Vincent

Hello,

I just try it but it doesn't works

The return is :
" Warning : Can't Add GPS:GPSImgDirection (not a list type).

The increment fonction don't work because the command

exiftool -gpsimgdirection=90 FILE work.

What's wrong ?

The command with If Test don't work too.

Thank's

Vincent

I try a new test.

The command line :
exiftool -GPSImgDirection=-90 FILE

don't work. I can't fix negative value for GPSImgDirection field.

I need help. Can you modify the first method with ExifTool_Config file and add a test sequence like :

If value >= 90 then newvalue = value - 90
Or if value < 90 the newvalue = value +270

For memorie,

    'Image::ExifTool::Composite' => {
        MyDirection => {
            Require => 'GPSImgDirection',

If .....

            ValueConv => '$val - 90',

Or ....

ValueConv => '$val + 270',
        },
    },

Thank's.

Vincent

I found and it's work

Image::ExifTool::Composite' => {
        MyDirection => {
            Require => 'GPSImgDirection',
            ValueConv  => q{
      return $val - 90 if $val >90;
      return $val +270 if $val <90;
      },
        },

Phil Harvey

Right. I didn't realize that GPSImgDirection was an unsigned number, so you are correct that it can't go negative.

But the "+=" should still work for you to increment this value as long as the result is positive and you are using ExifTool 8.61 or later.

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