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