1
2
3
4
5
6
7
8
9
#!/bin/sh
#By Don Southard aka @binaryghost

NAME=${1%.*}
EXT=${1##*.} 
if [[ $EXT = "png" ]]; then CONVERTED=`echo $NAME.jpg`
else CONVERTED=`echo $NAME.png`
fi
/usr/local/bin/convert "$1" "$CONVERTED"