My wife and I do a lot of image processing of our family photos plus the photos of Lisa’s balloons. The most common things that we want to do is to rotate images by 90 degrees to make a portrait photo upright and rename the imagest to be named by the date and name. To do this I simply wrote a few bash scripts and put them in the ‘.gnome2/nautilus-scripts’ directory, then they appeared in the scripts list of the right click context menu in the nautilus file browser windows. This is especially useful as it allows you to select a whole bunch of photos and right click them to get them changed all at once. Note that the scripts do presume a hard wired temporary directory to use for the transforms and also require the exiftool to be accessible on the system.
name_to_date_and_time.sh
#!/bin/bash TMP_FILE=`tempfile 2> /dev/null` || TMP_FILE="/tmp/nautilus-script.$$" IFS=" " trap "rm -f $TMP_FILE" EXIT for F in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do cd `dirname $F` mv $F `exiftool -T -d "%Y-%m-%d %H-%M-%S" -createdate $F` done
rotate_left.sh
#!/bin/bash TMP_FILE=`tempfile 2> /dev/null` || TMP_FILE="/tmp/nautilus-script.$$" IFS=" " trap "rm -f $TMP_FILE" EXIT for F in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do cd `dirname $F` mv -f $F $TMP_FILE jpegtran -copy all -rotate 270 -outfile "$F" $TMP_FILE done
rotate_right.sh
#!/bin/bash TMP_FILE=`tempfile 2> /dev/null` || TMP_FILE="/tmp/nautilus-script.$$" IFS=" " trap "rm -f $TMP_FILE" EXIT for F in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do cd `dirname $F` mv -f $F $TMP_FILE jpegtran -copy all -rotate 90 -outfile "$F" $TMP_FILE done