For JPG only files the following command invocation should do the job: exiftool -r '-FileName -r optional switch for operating recursively into all subdirectories '-filenameNote the extra '%' necessary to escape the filename codes (%c and %e) in the date format string. For Windows, the command line to append file extensions where they do not exist (using free downloadable utility ExifTool): exiftool -r '-filenameall images in "dir" according to the "CreateDate" date and time, adding a copy number with leading '-' if the file already exists ("%-c"), and This is from the exiftool documentation, under "Renaming Examples" exiftool '-FileName ![]() ![]() Rename uses perl code in the regex to format and increment counter. This lists files in order by creation time (newest first, add -r to ls to reverse sort), then sends this list of files to rename. ![]() To actually perform the renaming, remove the -nĮdit To start with a given number, you can use the (somewhat ugly-looking) code below, just replace 123 with the number you want: ls -1 -color=never -c | xargs rename -n 's/.*/our $i if(!$i) sprintf("%04d.jpg", $i++)/e' NOTE The rename commands here includes -n which previews the rename. The most useful application of this feature is to organize images by date/time, but any other tag value may also be used. If your rename doesn't support -N, you can do something like this: ls -1 -color=never -c | xargs rename -n 's/.*/our $i sprintf("%04d.jpg", $i++)/e' By writing the FileName and/or Directory tags, ExifTool can be used to rename and/or move images into directories according to any information contained in the image. To actually perform the renaming, remove the -n This will let exiftool know that the CreateDate, which is supposed to be written as UTC time, was correctly written and to adjust it to the local time. If this option is checked, the new names of all items of the File and folder list are formed and shown immediately after every change in the settings. b) For this command to work, the CreateDate tag must exist in the source file. The -ext option may be used to rename other file types (eg. Use ' exiftool -listwf ' to list the extensions of currently writable file types. Thanks in advance for any help, I have been doing a ton of googling on this and have been pretty confused.NOTE The rename commands here include -n which previews the rename. 1 Answer Sorted by: 1 If the timezone (+09:00) is the local time on the computer you are using, then add -api QuickTimeUTC to the command. a) When a directory name is specified, this command will only rename 'writable' files in the directory. I just want to add the camera make/model in front of the year ex: In general, ExifTool may be used to write metadata to read-only files provided that the user has write permission in the directory. Here is the working script to rename photos with the date taken: exiftool '-FileName ![]() I have been sorting my family photos, including some from a recovered backup drive my dad had.
0 Comments
Leave a Reply. |