system("convert -geometry 500x500 \"$source\" +profile '*' \"$destination\"");
that's what i use. the 500x500 is the max height/width you want the final image to be. it WILL keep proportions. the +profile will remove any extra info in the file that many digital camera add in. it is not needed if you don't care about it. I use it cause it makes the file about 7k smaller.