ExifTool Forum

ExifTool => Newbies => Topic started by: krzysiu on August 10, 2017, 11:49:39 AM

Title: Renaming photos with date and title
Post by: krzysiu on August 10, 2017, 11:49:39 AM
Hey! I'm not really a newbie. I know it sounds "do the job for me", but the point is I have worse day, I can't concentrate at all and I'd love to send some photos for people who asked for it. I'm simply not able to understand simplest things, so I'm asking you for exact command. I have JPEG photos (from CR2, but most metadata is kept) and I'd like to rename them in following format:
[yyyy-mm1-dd hhhmm2m] Photo title.jpg
1 month
2 minutes

The h and m means literal letters, so the name I'd want to achieve is e.g. [2017-08-02 22h15m] Spider that scared me to death.jpg (really it did - it was so called wasp spider)

So now there are things that you should know:

And my questions:

Sorry, I know you can find it in the Internet, but I'm really out of my mind and playing with my photos, makes me better :( I tried, I failed.

I promise to post even more tutorials to thank you. For now I did some crappy application (only for Windows and can break any time if Phil would use different HTML format), which could serve as "thank you" (I'll post it in different topic soon). There it is: https://github.com/Krzysiu/exifNeatHTML

But as I'm a programmer I can help you with some things. Or I can add you to thanks section of my photo gallery with link to website. Again sorry for asking question probably answered 100 times.
Title: Re: Renaming photos with date and title
Post by: Phil Harvey on August 10, 2017, 12:15:51 PM
You could put the title in XMP:Title (the default location for the "Title" tag):

exiftool -title="some title" FILE

And to rename as you desire:

exiftool "-filename<${createdate} ${title;}.%e" -d "[%Y-%m-%d %Hh%mm]" DIR

This should work assuming CreateDate exists.  If it doesn't, you can add fallbacks in reverse order of priority, eg:

exiftool "-filename<${filemodifydate} ${title;}.%e" "-filename<${datetimeoriginal} ${title;}.%e" "-filename<${createdate} ${title;}.%e" -d "[%Y-%m-%d %Hh%mm]" DIR

- Phil