renaming images to include creation date in name

When I look at the properties of an image, I can see the date the photo was taken in “Date Taken”. When I edit the images (proprietary program) this data gets lost.

How can I rename the image files before editing to include this date (preferably in ISO format for sorting by name).

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You can do this with exiftool. From the man page:

   exiftool '-FileName<CreateDate' -d %Y%m%d_%H%M%S%%-c.%%e dir
        Rename all images in "dir" according to the "CreateDate" date and
        time, adding a copy number with leading '-' if the file already
        exists ("%-c"), and preserving the original file extension (%e).
        Note the extra '%' necessary to escape the filename codes (%c and
        %e) in the date format string.

The example format should get you ISO format filenames. Include the time to make sure you can handle multiple images per day.

Method 2

The exiv2 tool can rename files using the timestamps:

from man exiv2:

mv | rename

Rename files and/or set file timestamps according to the Exif create timestamp. Uses the value of tag Exif.Photo.DateTimeOriginal or, if not present, Exif.Image.DateTime to determine the timestamp. The filename format can be set with -r fmt, timestamp options are -t and -T.

so the following might do what you want:

exiv2 mv *.JPG


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x