php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59381 Imagick::newPseudoImage Radial Gradient Error
Submitted: 2010-08-23 10:42 UTC Modified: 2013-02-18 00:35 UTC
From: nkline at kent dot edu Assigned:
Status: No Feedback Package: imagick (PECL)
PHP Version: 5.1.6 OS: RedHat EL 5.5
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-08-23 10:42 UTC] nkline at kent dot edu
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).

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-18 04:25 UTC] mkoppanen@php.net
Hi,

this works with ImageMagick 6.5.8 in my test environment. Maybe you are running older ImageMagick that doesn't yet support this functionality?
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 15 12:01:34 2019 UTC