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
Equivalent command in Magickwand for convert -resize
Re: Equivalent command in Magickwand for convert -resize
use MagickTransformImage(). It accepts a geometry specification with meta-characters.
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Equivalent command in Magickwand for convert -resize
I thought that would be easy but can't get it to work the way I thought it would.I require a different convert command variation.
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")
Pete