Hello,
I'm using the Exif Perl Library which is very useful.
I also want to use it for geotagging my pictures from GPX files.
I can't see how to do it in documentation ....
Can you help me? or may I use a GPX library and integrate the position by myself...
Thank you
Take a look a the Geotagging with ExifTool (https://exiftool.org/geotag.html) for some of the basics for the command line.
Translating that to using Perl might take a response from Phil (the author) who is currently on vacation.
Thank you for your answer :)
Yes I know the command line, but I don't know how to "translate" in into Perl
Have you already read the documentation (https://www.exiftool.org/ExifTool.html)? From that and knowing what the command line would look like it should be pretty straightforward. If not, can you share the command-line you want to run as Perl code?
Thank you for your answer
I don't find information about geotagging in the Exiflib documentation
The command line will look like this one
exiftool -geotag=track.log /Users/Phil/Pictures
cf the geotagging page https://exiftool.org/geotag.html (https://exiftool.org/geotag.html)
And I don't know how view in the Exiftool library how the command line is interpreted
Ah, I see. You want to use the Perl API to match the gps track, not write individual tags. This is something that isn't possible. I see three alternatives:
- Call that exiftool command from within exiftool using e.g. the system command or backtick operator.
- Write your own matching code and use the API functions to write the metadata to the file(s).
- Ask Phil if there is an internal function that accomplishes this and then make use of that function.
The first alternative is the simplest, of course.
I can't use the command line, because in my directory, I can have hundreds of pictures already geotagged or that can't be geotagged.
So if I can't do it directly with Phil's help, I'll use the GPX library to putthe positionin each photos.
Do you know if Phil is oftenly looking to this forum ?
Quote from: servanges on February 06, 2019, 02:14:46 AM
So if I can't do it directly with Phil's help, I'll use the GPX library to putthe positionin each photos.
Do you know if Phil is oftenly looking to this forum ?
Phil is currently on vacation, but when he's back he'll get back to you (he reads the forums multiple times a day)
Quote from: servanges on February 06, 2019, 02:14:46 AM
I can't use the command line, because in my directory, I can have hundreds of pictures already geotagged or that can't be geotagged.
I'm not sure I understand why you can't use the command line. Files that are already geotagged can be skipped with
-if "not defined $GPSLatitude". Why can't the others be geotagged? If they don't have the timestamp or are not in the geotrack, they'll be skipped. If they're not a supported filetype, they'll be skipped.
All you need to do is use SetNewValue() to set the value of the GeoTag tag (to the name of the GPS file), and use SetNewValuesFromFile() to set GeoTime to DateTimeOriginal (or whatever tag you want), then call WriteImage() to do the geotagging. See the "Programmers" notes on this page (https://exiftool.org/geotag.html).
- Phil
Hi,
Thank you very much for your help, and all the work you do
It's very simple to use, very good architecture though to help. (Sorry, I've missed the programmer lines)
I'll try very soon.
Claude
Nice! I had no idea that it would be possible to set the tag this way. I missed this part of the docs too ::)
Those Extra Tags (https://exiftool.org/TagNames/Extra.html) are a treasure trove.
- Phil