Convert png and gif file to jpg in bash script
Published on 29.10.2014
Very quick script for converting all png and gif files in directory to jpeg with image magick.
set -e dir=/var/www/default/public_images for ext in png gif; do for i in `find "$dir" -type f -regex '.*'$ext `; do ( filename=${i%.*} convert "$i" -quality 90 -strip "$filename.jpg" echo "$filename" ) done done