回答:
convertでこれを実行できないことはわかりません。
ここを見てください:
http://www.imagemagick.org/Usage/crop/#crop
サムネイルを作成し、元の画像の幅と高さを識別するスクリプトを次に示します。
#!/bin/bash
# Define a fixed resolution
long=500
short=600
# Creating thumbnails
(for i in *.png *.jpg; do
width=`identify -format %w $i`
height=`identify -format %h $i`
if [ $width -ge $height ]; then
size=${long}x
else
size=x${short}
fi
echo "# Resizing $i $width""x""$height -> $size" ;
convert -resize $size -quality 80 -gravity center -extent $size -background white $i /media/path/to/destination
done
)
ニーズに合わせて変更できます。