Rename Image Files based upon the EXIF GPS Altitude / Height

Started by rikbijl, November 22, 2024, 02:51:27 AM

Previous topic - Next topic

rikbijl

Hi all,
Wondering if you can Rename Image Files based upon the EXIF GPS Altitude / Height ?
If this is possible than I would like tot arrange the renamed files in seperate directories / folders
For example : all pictures between 100-120 meters in a dir/folder named 100-120.
Hope somebody can help .

Cheers Rik

StarGeek

This will sort files into subdirectories below there currently location. It gets funky with negative numbers though
exiftool "-Directory<${GpsAltitude#;my $lb=(int($_/100)*100);$_=$lb.'-'.($lb+99)}" /path/to/files/

Example. Note how negative numbers are off. That is because the int (integer) rounds toward 0. This means -1 to -99 will end up in the postive grouping. If you need more accuracy with negative numbers, it will be more complex and probably should require a config file.

C:\>exiftool -G1 -a -s -Composite:GPSAltitude# Y:\!temp\x\y
======== Y:/!temp/x/y/Test1.jpg
[Composite]     GPSAltitude                     : 42
======== Y:/!temp/x/y/Test2.jpg
[Composite]     GPSAltitude                     : 742
======== Y:/!temp/x/y/Test3.jpg
[Composite]     GPSAltitude                     : -42
======== Y:/!temp/x/y/Test4.jpg
[Composite]     GPSAltitude                     : -742
    1 directories scanned
    4 image files read

C:\>exiftool "-TestName<${GpsAltitude#;my $lb=(int($_/100)*100);$_=$lb.'-'.($lb+99)}" Y:\!temp\x\y
'Y:/!temp/x/y/Test1.jpg' --> 'Y:/!temp/x/y/0-99'
'Y:/!temp/x/y/Test2.jpg' --> 'Y:/!temp/x/y/700-799'
Warning: File 'Y:/!temp/x/y/0-99' would exist - Y:/!temp/x/y/Test3.jpg
'Y:/!temp/x/y/Test4.jpg' --> 'Y:/!temp/x/y/-700--601'
    1 directories scanned
    0 image files updated
    4 image files unchanged
"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