Discussion:
convert landscape and portrait files
blau
2010-09-27 13:21:00 UTC
Permalink
I have some dozen jpg files together, some landscape oriented, some
portrait.
How do I convert the jpgs, so that the width only is always (eg) 500 px ?

When I convert it as below, the longest between width/height gets
resized to 500 px.

blau:~$ for i in *.jpg; do convert "$i" -resize 500 \
"${i//.jpg}"-500.jpg; done

Blau
Fred Weinhaus
2010-09-27 17:10:55 UTC
Permalink
see http://www.imagemagick.org/script/command-line-processing.php#geometry


width
Width given, height automagically selected to preserve aspect ratio.

convert image -resize WIDTH result

seems to work for me. (Also WIDTHx)

IM 6.6.4.7 Q16 Mac OSX Tiger.

Are you on an old release of IM? Perhaps you need to upgrade.
Post by blau
I have some dozen jpg files together, some landscape oriented, some
portrait.
How do I convert the jpgs, so that the width only is always (eg) 500 px ?
When I convert it as below, the longest between width/height gets
resized to 500 px.
blau:~$ for i in *.jpg; do convert "$i" -resize 500 \
"${i//.jpg}"-500.jpg; done
blau
2010-09-28 13:12:30 UTC
Permalink
Post by Fred Weinhaus
Are you on an old release of IM? Perhaps you need to upgrade.
Thank you. It is probably an old version issue, testing on a different
machine now works as intended.

Blau

Mikolaj Machowski
2010-09-27 17:56:36 UTC
Permalink
Post by blau
I have some dozen jpg files together, some landscape oriented, some
portrait.
How do I convert the jpgs, so that the width only is always (eg) 500 px ?
When I convert it as below, the longest between width/height gets
resized to 500 px.
blau:~$ for i in *.jpg; do convert "$i" -resize 500 \
"${i//.jpg}"-500.jpg; done
Try -resize "500x" <- you have to tell IM which (width/height) is important

m.
Loading...