Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set height only when resizing using ImageMagick

The following code resizes an image so that its width is 200 and its height is whatever... How would I do it so that the height was 200 and the width was whatever...

$command = MAGICK_PATH."convert ".$filename." -resize 200 ".$filename; exec($command);

Kind regards J

like image 806
jon Avatar asked Oct 09 '11 18:10

jon


1 Answers

The manual has a complete overview over resizing options.

You are looking for

xheight Height given, width automagically selected to preserve aspect ratio.

like image 78
Pekka Avatar answered Sep 20 '22 19:09

Pekka