Rename file based on GPS Point of Interest

Started by brad_e7588, August 06, 2017, 05:09:21 AM

Previous topic - Next topic

brad_e7588

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

Phil Harvey

Hi Brad,

First you need to figure out the TAG that stores the landmark information (see FAQ 2).

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

StarGeek

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 (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.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype