Renaming photos based on filename

I found some photos of a rock climbing group from work. They were named “Cora At Top.JPG”, which is great to look at the once, but they don’t really fit into the archival scheme. Plus I didn’t want to have to reenter the caption, since it was encoded into the filename already.

I reached into the new release (2.7.4) of the ever useful EXIFUtils and checked the field name list. I found [file-name] and [file-base], which represent as a source the file name e.g. “Cora At Top.JPG” and the base file name “Cora At Top”. So by entering:

> exifedit /a ip-caption=[file-base] .

I add a IPTC-Caption tag to each file using the file base name as the caption. The brackets make it a “macro”, otherwise the literal text “file-base” is inserted, which is not what I wanted. The dot is *.*.

The program creates a bunch of backup files, which I deleted. The /b option does not create backups. Next time.

Then I use my imgnum script to reformat the name to the FSC_YYYYMMDD_HHMMSS std format.

"%EXIFUTILS_HOME%\exiffile.exe" /t /n VVKG[date-taken].jpg .
rem fix VVKGYYYY-MM-DD HH-MM-SS.JPG to VVKGYYYYMMDD_HHMMSS.JPG
rem change space to _
%CYGWIN_HOME%\bin\rename.exe " " "_" *.jpg
rem change dash to null
%CYGWIN_HOME%\bin\rename.exe - "" *.jpg
%CYGWIN_HOME%\bin\rename.exe - "" *.jpg
%CYGWIN_HOME%\bin\rename.exe - "" *.jpg
%CYGWIN_HOME%\bin\rename.exe - "" *.jpg

This entry was posted in Computers, howto, Software and tagged , , , , . Bookmark the permalink.

Leave a Reply