Add Date Time Stamp to JPEG Photos Using Free Open Source Software To get it started, follow the simple steps. 1. Install ImageMagick
sudo apt-get install ImageMagick2. Get the font http://www.dafont.com/digital-7.font To make it look like the old 35mm point-and-shoot film cameras time stamp, you can use a LCD font. Simply downloaded it and unpacked it somewhere. You dont have to install the fonts. The script can work by a direct link to the font file location. 3. Get the code The following is the complete shell script.
#!/bin/sh # Change the font variable to point to your font location font="$HOME/.fonts/digital-7 (mono).ttf"
if [ $# -eq 0 ] then cat << _EOF_
USAGE: $0 file1 file2 ..., or $0 *.jpg, or $0 dir/*.jpg ...
_EOF_ exit fi
while [ "$1" != "" ]; do # Skip directories if [ -d "$1" ]; then shift continue fi # Skip already converted files (may get overwritten) if [[ $1 == *_DT* ]] then echo "------ Skipping: $1" shift continue fi
# Work out a new file name by adding "_DT" before file extension
file=$1
echo "###### Working on file: $file"
filename=${file%.*}
extension=${file##*.}
output=${filename}_DT.${extension}
# Get the file dimension
dim=$(identify -format "%w %h" "$file")
width=${dim%% *}
height=${dim#* }
# Decide the font size automatically if [ $width -ge $height ] then pointsize=$(($width/30)) else pointsize=$(($height/30)) fi
echo " Width: $width, Height: $height. Using pointsize: $pointsize"
# The real deal here convert "$file" -gravity SouthEast -font "$font" -pointsize $pointsize -fill white -annotate +$pointsize+$pointsize "%[exif:DateTimeOriginal]" "$output"
shift done
exit 04. Do the work Copy the code into a text editor, save it as dtstamp.sh or anything you like. Please note you need to change the 3rd line in the code to point to the font file location. Run the following command to make it executable chmod +x dtstamp.sh To use it, simply run it like this ./dtstamp.sh directory/*.jpg Or, ./dtstamp.sh file1.jpg file2.jpg... After it runs, the script will produce files with _DT inserted between the original file name and file extension. The original file is unmodified.

