|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-11-18 04:25 UTC] mkoppanen@php.net
[2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 19:00:02 2025 UTC |
Description: ------------ imagick 3.0.1RC1 RedHat Enterprise Linux 5.5 PHP 5.1.6 ImageMagick 6.2.8.0 When using Imagick::newPseudoImage to create a radial gradient, this error appears in the Apache HTTP error log and the radial gradient is not created: 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 The documentation at http://us.php.net/manual/en/function.imagick-newpseudoimage.php is lacking but 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)." I've tried using "RADIAL_GRADIENT" instead of "radial-gradient" and every other combination I could think of. Utimately, I would like to feed Imagick::newPseudoImage RGB values instead of hex and save the created images to disk. Reproduce code: --------------- <?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; ?> Expected result: ---------------- A radial gradient image in PNG format should be displayed in the web browser. Actual result: -------------- The script returns nothing and logs a fatal error in the Apache HTTP log (see description for details).