Problem creating XMP file with GPS-Data

Started by Archive, May 12, 2010, 08:54:20 AM

Previous topic - Next topic

Archive

[Originally posted by springm on 2008-04-14 14:52:10-07]

Code:
my $xmp = new Image::ExifTool;
my ($success, $errStr);
($success, $errStr) = $xmp->SetNewValue(Author => 'Phil Harvey');
($success, $errStr) = $xmp->SetNewValue( "GPSLatitude" => '47,45.187000N',
                                         'Group' => 'exif' );
warn "problem writing. Error: $errStr\n" if $success != 1;
($success, $errStr) = $xmp->SetNewValue( "GPSLongitude" => '13,6.915000E',
                                         'Group' => 'exif' );
warn "problem writing. Error: $errStr\n" if $success != 1;
$success = $xmp->WriteInfo(undef,'new_xmp_file.xmp');
creates an xmp file from scratch, but this contains only the author name and not, as expected, the GPS longitude and latitude. When I create an xmp file from a jpg containing those values, they get transferred into the xmp file. What am I doing wrong here?

Archive

[Originally posted by exiftool on 2008-04-14 15:07:13-07]

You are trying to write the GPSLatitude/Longitude tags in EXIF,
but you need to write them to XMP (ie. Group => 'XMP')

- Phil

Archive

[Originally posted by exiftool on 2008-04-14 15:09:43-07]

I should have mentioned that it will also work if you don't
specify any group, since tags in the XMP group are created
by default when writing to XMP files.

Archive

[Originally posted by springm on 2008-04-14 15:37:01-07]

Thanks a lot, Phil - that resolved my problem. As in the xmp file itself the tags are prefixed with 'exif:', I assumed that was the group name.

Archive

[Originally posted by exiftool on 2008-04-14 15:51:28-07]

I debated whether or not I should get into a discussion of XMP
namespaces and exiftool group names, but since you brought
it up, here is a quick comment that may help clear things up
a bit:

'exif' is the XMP namespace prefix.  If you want, you can write
to a specific namespace with exiftool, but the associated family 1
group name looks like "XMP-exif".

However, in your case it is not necessary to get so specific
since the GPS tags only exist in one namespace.

- Phil

Archive

[Originally posted by springm on 2008-04-14 18:14:55-07]

Phil, I have to admit I have just scratched the surface of photographic metadata. Therefore I admire even more the logic behind Image::Exiftool, doing most of the things just right without asking for too many decisions. My homegrown GPS-Metadata writer now updates my raw files, too, make the whole workflow just more consistent. And a plugin, querying ws.geonames.org, can add the place names related to the coordinates, too. No downstream software I uses (I admit, all linux or server based ones) has ever complained about the written metadata, so I guess that everything is pretty much all right.

So thanks a lot for your patience and your thoughtful answers.

Regards - Markus