Anyone out there using the Imagick::newPseudoImage function to create
radial gradient images? The documentation at
http://us.php.net/manual/en/function.imagick-newpseudoimage.php is
lacking.

When I try using Imagick::newPseudoImage to create a radial gradient,
this error appears in the Apache HTTP error log:

PHP Fatal error:  Uncaught exception 'ImagickException' with message
'Unable to create new pseudo image: radial-gradient:#FF0000-#FFFFFF'
in /var/www/html/energy/scripts/rg.php:6\nStack trace:\n#0
/var/www/html/energy/scripts/rg.php(6): Imagick->newpseudoimage(150,
150, 'radial-gradient...')\n#1 {main}\n  thrown in
/var/www/html/energy/scripts/rg.php on line 6

According to http://www.imagemagick.org/script/formats.php (search for
"radial"):
"RADIAL_GRADIENT...Gradual radial passing from one shade to
another...Returns a rendered radial gradient image using the specified
image size. Specify the desired shading as part of the filename (e.g.
radial-gradient:red-blue or radial-gradient:#F00-#00F)."

Yes, I've tried using "RADIAL_GRADIENT" instead of "radial-gradient"
and every other combination I could think of.

My PHP Script:
<?php
        // Create a new imagick object.
        $image = new Imagick();

        // A new image with radial gradient fading from red to white,
150 by 150 pixels.
        $image->newPseudoImage(150,150,'radial-gradient:#FF0000-#FFFFFF');

        // Set the image format to PNG.
        $image->setImageFormat('png');

        // Output the image.
        header("Content-Type: image/png");
        echo $image;
?>

PHP: 5.1.6
OS: RHEL 5

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to