ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: sevy on April 14, 2019, 11:21:10 AM

Title: conditionnal renaming files (with no gps info)
Post by: sevy on April 14, 2019, 11:21:10 AM
Hello,

I know how to rename files according creation date, I learn how to find pictures with no gps info but how to rename pictures with no gps info ?
I'm trying to get this result : if the picture "filename.jpg" does not contain gps info, it should renamed as "filename_NOGPS.jpg"

I guess this operation should be possible with Exiftool but impossible to find the way.

thanks in advance for your help,

sevy
Title: Re: conditionnal renaming files (with no gps info)
Post by: StarGeek on April 14, 2019, 11:36:41 AM
Try
exiftool -if "not $GPSLatitude" "-FileName=%f_NOGPS.%e"

In this example, if there is no latitude data, it's quite unlikely that there is any other useful GPS data.  The GPSVersionID tag might exist, as a lot of cameras will embed that even when no other GPS data is added.

edit: Fixed error
Title: Re: conditionnal renaming files (with no gps info)
Post by: sevy on April 14, 2019, 01:51:20 PM
hello,

Thanks for the quick reply !
I tried your suggestion with test-files but I got an error message :
Warning: No writable tags set from ./FILENAME.JPG
Warning: Invalid tag name '%f_nogps.%e' - ./FILENAME.JPG

Files with no gps have been correctly identified but not modified.

I forgot to write I'm working with Win10 and the last version of ExifTool (11.35)
Title: Re: conditionnal renaming files (with no gps info)
Post by: Hayo Baan on April 14, 2019, 02:06:56 PM
Change the < into an = and it should work.
Title: Re: conditionnal renaming files (with no gps info)
Post by: StarGeek on April 14, 2019, 02:23:45 PM
And there I go getting bitten by the < vs = difference again :D

Funny thing is I started off correctly, then started to do a different version using $FileName, then decided to revert to the simplest form and expand later if needed, but forgot to fix that part.
Title: Re: conditionnal renaming files (with no gps info)
Post by: Hayo Baan on April 14, 2019, 02:43:46 PM
Quote from: StarGeek on April 14, 2019, 02:23:45 PM
And there I go getting bitten by the < vs = difference again :D

Funny thing is I started off correctly, then started to do a different version using $FileName, then decided to revert to the simplest form and expand later if needed, but forgot to fix that part.

Ha yes, that one still bites me sometimes as well. It took me a while before I saw the problem. In fact I had to run the command myself to see what could have been wrong ;)
Title: Re: conditionnal renaming files (with no gps info)
Post by: sevy on April 14, 2019, 02:57:54 PM
Hello,

thanks a lot  / hartelijk bedankt to StarGeek and Hayo : it's working perfectly !