ExifTool Forum

ExifTool => Newbies => Topic started by: Shane on April 15, 2020, 02:33:01 PM

Title: How can I rename files from two different EXIF tags?
Post by: Shane on April 15, 2020, 02:33:01 PM
Hello.

I have a series of images that will have the GPSImgDirection and CameraElevationAngle tag values populated with the Yaw and Pitch of the camera. I want to rename the files to match the values of those two tags.

For example DSC_0001.jpg with the GPSImgDirection tag value of 270 and the CamerElevationAngle tag value of -30 to be renamed as 270-30, or ideally Yaw270_Pitch-30.jpg. And potentially add a prefix to the name like Pos01_Yaw270_Pitch-30.jpg

I have searched the documentation and forums about renaming files using two tags, but I have not found anything. Any help would be appreciated. It might be that the only way to go is exporting those tags to a CSV file so I can do the formatting in Excel and then using that to rename the files, but I was hoping to do it all through the command prompt.

Thanks,
Shane
Title: Re: How can I rename files from two different EXIF tags?
Post by: Phil Harvey on April 15, 2020, 02:43:56 PM
Hi Shane,

This page (https://exiftool.org/filename.html) has lots of useful information about renaming files.

Try this:

exiftool "-testname<Pos01_Yaw${GPSImgDirection}_Pitch${CameraElevationAngle}.%e" DIR

If this does what you want, then change "testname" to "filename" to actually do the renaming.

- Phil
Title: Re: How can I rename files from two different EXIF tags?
Post by: Shane on April 15, 2020, 03:16:42 PM
Hi Phil,

That worked perfectly. I did look through that page previously, but must have missed something. Thanks for the help.

Shane