Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer
2  
See also jhead –  Stéphane Chazelas Jan 23 at 12:13

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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