use a "string" value to set parameters for MagickTransformIm

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

use a "string" value to set parameters for MagickTransformIm

Post by eholz1 »

Hello I stumped!!!
I am trying to use the following type of code to transform an image.
$size = $width.'x'. $height;

$resizedImage = MagickTransformImage( $magick_wand, '0x0', "$size");

this does not work for me - it works fine if I use:

$resizedImage = MagickTransformImage( $magick_wand, '0x0', '600x500'); etc.

I have tried different ways to get the string value in the command, but no luck. (adding "dinks", etc)
Do you have any idea on how i can pass parameters to the various Magickwand functions???

Also what would be some generic setting for MagickSharpenImage($resizedImage, 0.0,1.0);
I would just like to do a "generic" sharpen to the image before I write it.

thanks for your help,
eholz1
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: use a "string" value to set parameters for MagickTransformIm

Post by magick »

This works for us:
  • $size = $width . 'x' . $height;
    $resize_image = MagickTransformImage($image, '0x0', $size);
eholz1
Posts: 10
Joined: 2007-02-04T20:18:17-07:00

Re: use a "string" value to set parameters for MagickTransformIm

Post by eholz1 »

I did discover one thing after I made this post - if the image size is the same i.e. before "size" = after "size",
the image transform will not transform! so - what I did, was shrink my height and width by a few pixels (like 100),
and then I would get a $resouce_image from the wand, etc.

Thanks,

eholz1
Post Reply