Some 5 years back, I wrote on this blog on how to set the caption of a image as it file name. In those days, I used to change the filename first and then set the caption for picasa. Now things have moved online and today I set the caption first is Google + (which did not exist then) and then downloaded the album to my local picasa and tried to rename the file. How to do it?
With some Windows commandline revision and use of Exiv2 I was able to achieve it. So here it goes.
With some Windows commandline revision and use of Exiv2 I was able to achieve it. So here it goes.
- I assume that you have downloaded the picasa web album to a local folder using picasa.
- Open command window and type in :
forfiles /C "cmd /c ..\exiv2 -g Exif.File name -g Iptc.Application2.Caption -Pv @file" > files.txt - This will create a file "files.txt which will look like :
100.jpg 1. My caption
where the 1st column is the File Name and the 2nd column is the given caption. - Open the files.txt in Notepad++ and edit it. Replace the huge space between the filename and caption with some deliminator like ';'. The result should look like:
100.jpg;1. My caption - Now in the command window type in:
for /f "tokens=1,2 delims=;" %i in (files.txt) do ren "%i" "%j.jpg"
This will take the filename as the first token and caption as the 2nd token as we have used the deliminator ';' and then do a rename. Note that I have use %j.jpg" to give it the correct extension. - And the job is done :)
No comments:
Post a Comment