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.
I have been working on a project in which i need to get all of the pixel information from a picture. I found ImageMagick and MagickWand, and installed them on my server. I tried to follow the vague example given in the information on the MagickWand site, and cannot get the MagickGetImagePixels to return anything but the word "Array"
Code: Select all
$magick_wand = NewMagickWand();
$height = MagickGetImageHeight($magick_wand);
$width = MagickGetImageWidth($magick_wand);
$pixels = MagickGetImagePixels($magick_wand, 0, 0, 20, 24, 'RGBA', MW_charPixel);
print$height . ", " . $width;
print "RGB(" . $pixles . ", " . $pixles . ", " . $pixles . ");";
I used that test code just to see if i can get it to work, but it doesn't. What am i doing wrong?
- Site Admin
- Posts: 11254
- Joined: 2003-05-31T11:32:55-07:00
You misspelled pixels. We corrected that and the script seemed to work and returns:
- 46, 70<br />RGB(47, 45, 255);<br />
I feel incredibly stupid. I looked over this code for almost an hour, trying to figure out what was wrong. Thank you for the help though.