Equivalent command in Magickwand for convert -resize

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
eholz1
Posts: 10
Joined: 2007-02-04T20:18:17-07:00

Equivalent command in Magickwand for convert -resize

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Equivalent command in Magickwand for convert -resize

Post by magick »

use MagickTransformImage(). It accepts a geometry specification with meta-characters.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Equivalent command in Magickwand for convert -resize

Post 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
Post Reply