Page 1 of 1

Equivalent command in Magickwand for convert -resize

Posted: 2007-02-05T13:06:56-07:00
by eholz1
I have been looking for a command in magickwand for php,
that will do the same thing as this command line entry for ImageMagick

convert spyder.jpg -resize 900x752\> resize_spyder.jpg - in this case the height is the factor I want limited.
the width actually comes out to less than 900 (which is fine) I can run this command by shelling out, but would
prefer to run it within the php code using magickwand.

I want to limit the height of vertical images to 750 (plus or minus) pixels. the max width is 900 px for horizontal images.

I like the way Imagemagick "guesses" at an appropriate image width using the "greater than" or "less than" syntax.

thanks for any info,

eholz1

Re: Equivalent command in Magickwand for convert -resize

Posted: 2007-02-05T13:45:48-07:00
by magick
use MagickTransformImage(). It accepts a geometry specification with meta-characters.

Re: Equivalent command in Magickwand for convert -resize

Posted: 2007-06-20T14:38:24-07:00
by el_supremo
I require a different convert command variation.
I thought that would be easy but can't get it to work the way I thought it would.
I tried this:

Code: Select all

magick_wand = NewMagickWand()
p_wand = NewPixelWand()
PixelSetColor(p_wand,"white")

MagickNewImage(magick_wand,1,400,p_wand)

MagickReadImage(magick_wand,"gradient:green-yellow")

MagickWriteImage(magick_wand,"gradient.jpg")
but it only results in a white line when using the latest windows binary - V6.3.4-10.

Pete