ExifTool Forum

ExifTool => Newbies => Topic started by: brad_e7588 on August 06, 2017, 05:09:21 AM

Title: Rename file based on GPS Point of Interest
Post by: brad_e7588 on August 06, 2017, 05:09:21 AM
Hello,

I apologize if this has been addressed somewhere else, but I have been unable to find an answer.  I want to add the name of the landmark/location where my photos were taken to the file name.  I assume this can be done somehow by accessing the GPS location stored in the metadata.  When I look at the photos on my iPhone or in Photos on my mac, it will say "Epcot Center," or "Indianapolis Motor Speedway," or "Chicago," etc.  How can I pull this info and include it in the photo's file name.
I have been using Exiftool, Automator, and Hazel so far and have been unable to do this.
Thanks for any help

Brad
Title: Re: Rename file based on GPS Point of Interest
Post by: Phil Harvey on August 06, 2017, 07:11:21 AM
Hi Brad,

First you need to figure out the TAG that stores the landmark information (see FAQ 2 (https://exiftool.org/faq.html#Q2)).

Then you can use this command:

exiftool "-filename<${TAG;}%-c.%e" DIR

to set all the file names.  I have added %-c to add a copy number if more than one picture is at the same landmark.  Add %f if you want to include the original file name somewhere in the new name.

- Phil
Title: Re: Rename file based on GPS Point of Interest
Post by: StarGeek on August 06, 2017, 04:42:26 PM
If I recall correctly, the tags that would hold info such as a landmark would be IPTC:Sub-location and XMP:Location.  But I have doubts that they've actually been written to the file.  I think it's more likely that the gallery program you're viewing your images with has done a gps lookup to collect the info, though I don't know enough about macs to say if it has been saved to the file, was saved to a database, or is looked up on the fly.

I would suggest running the command from FAQ 3 (http://www.exiftool.org/faq.html#Q3) (exiftool -G1 -a -s) and specifically look for IPTC:Sub-location and XMP:Location, possibly also City (an XMP and IPTC tag), possibly (though unlikely) LocationShownSublocation.  Those are the most likely places the info has been stored.