Okay, the reason I posted this is because I wasn\'t sure what to search for. I\'ll try to explain it as clearly as I can.
Say, I have an image sized 800x600. The box
I have a shell script in place that does exactly what you need with ImageMagick:
#!/bin/sh
SOURCE='/path/to/img'
FILE='myfile.jpg'
convert $SOURCE/$FILE -thumbnail 150x150^\> -quality 85% \
-gravity center -extent 150x150 ${SOURCE}150/$FILE
^ after 150x150 is essential! -thumbnail option strips all meta-information except for color profiles and is very fast.-gravity center -extent 150x150) - exactly what you want. -quality 85% which should be plenty while reducing file size a lot.img directory and write the thumbnail with the same filename to a img150 directory right next to it.Experiment for best results.
I had help from:
http://www.imagemagick.org/Usage/files/
http://www.imagemagick.org/Usage/resize/
http://www.imagemagick.org/script/command-line-options.php#thumbnail