[Originally posted by exiftool on 2006-10-06 17:02:01-07]This isn't simple, but it is do-able with the current release of ExifTool with user-defined tags.
First, be sure you have the most recent version of ExifTool since I've fixed some problems
with user-defined tags on Windows in version 6.45.
Then, create a file called ".ExifTool_config" in your home directory. Cut and paste the following into that file:
# The %Image::ExifTool::UserDefined hash defines new tags to be
# added to existing tables.
%Image::ExifTool::UserDefined = (
# Composite tags are added to the Composite table
'Image::ExifTool::Composite' => {
GPSLongitude2 => {
Require => {
0 => 'XMP:GPSLongitude',
},
ValueConv => 'abs($val[0])',
PrintConv => 'Image::ExifTool::GPS::ToDMS($self,$val,1)',
},
GPSLatitude2 => {
Require => {
0 => 'XMP:GPSLatitude',
},
ValueConv => 'abs($val[0])',
PrintConv => 'Image::ExifTool::GPS::ToDMS($self,$val,1)',
},
GPSLongitudeRef2 => {
Require => {
0 => 'XMP:GPSLongitude',
},
ValueConv => '$val[0] < 0 ? "W" : "E"',
PrintConv => {
E => 'East',
W => 'West',
},
},
GPSLatitudeRef2 => {
Require => {
0 => 'XMP:GPSLatitude',
},
ValueConv => '$val[0] < 0 ? "S" : "N"',
PrintConv => {
N => 'North',
S => 'South',
},
},
},
);
With this addition, you should be able to set the EXIF GPS tags like this:
exiftool "-gps:gpslatitude<gpslatitude2" "-gps:gpslongitude<gpslongitude2" "-gps:gpslatituderef<gpslatituderef2" "-gps:gpslongituderef<gpslongituderef2" image.jpg
Not pretty, but it should get the job done.
- Phil