mkNewsletterImg.sh

#!/bin/bash
 
MAX_HEIGHT=150
DENSITY=72
TARGET=/tmp/nl_$(date -I)
SOURCE=/media/bilder/300dpi
 
# create target directory
[ -d ${TARGET} ] || mkdir ${TARGET}
 
# convert images
for i in $@; do
        IMG=${i}.jpg
        convert "${SOURCE}/${IMG}" -resize "x${MAX_HEIGHT}" -density "${DENSITY}x${DENSITY}" -sharpen "0x1" "${TARGET}/${IMG}"
        echo "${IMG}: $?"
done