Re: Rename your .jpg images to EXIF date
Posted: 2010-12-07 06:44
It looks to me like the top part acts on a single file (since %f is the first selected file), while the bottom is acting on every file in the current directory. It seems like these tasks would better be separated-- for example, just make the action fix the file extension of the selected file, or perhaps have a separate action for fixing all file extensions in the directory, so that the operation isn't needlessly carried out repeatedly.mzilikazi wrote:This is a quick way to rename alot of images to something more useful than DSCF3727.JPGNew Action>Code: Select all
apt-get install jhead
Name: Rename To EXIF Date
Description: Rename image file to EXIF date/time
Command: /path/to/RenameToExifDate %f
Code: Select all
#!/bin/bash while [[ -n "$1" ]]; do #if a file and not a dir if [[ -f "$1" ]]; then jhead -nf%m.%d.%Y_%H:%M "$1" fi shift done for i in *.JPG; do mv $i `basename $i JPG`jpg; done
You could use a rename expression such as
Code: Select all
rename 'if ($_=~/^(.*\.)([A-Z]+)$/) { $_=$2; tr/[A-Z]/[a-z]/; $_=$1.$_}' *