Adding Image Unique ID to filenames

Started by met077, December 25, 2020, 01:17:21 PM

Previous topic - Next topic

met077

I use the command exiftool .\ -wm c "-ImageUniqueID<NewGUID#" -overwrite_original -r to add an Image Unique ID to each of my photos. After this I then use either Adobe Bridge or ExifTool to add that Image Unique ID to the last part of the image filename. The only issue I have with this is that the filename ends up quite long.

Is there a way to:

Rename the file using only the last 12 digits of the Image Unique ID (the part that is just a random number)?

Or

Using ExifTool set the Image Unique ID to only the last 12 digits that would normally be created by the create ImageUniqueID command?

Thanks

StarGeek

Use something like
${NewGUID;m/(.{12}$)/;$_=$1}

Either replace NewGUID# in your above command with this or as part of your rename command.

This uses a RegEx match m/(.{12}$)/ to capture the last 12 characters and sets the value of the tag to be equal to that capture $_=$1
"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