9

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).

13

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.

6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.