Help - Search - Members - Calendar
Full Version: Gd Library - Imagefilter()
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
skatana
Hi,
I'm trying to use the GD Library in PHP to change the color of an image in PHP. On my local server, it works ok, but when I upload my files to my zyic website, I get the following error:

Fatal error: Call to undefined function imagefilter() in /www/uuuq.com/s/k/a/skatana/htdocs/demo/twinkling/index.php on line 221

Here is my code:

CODE
<?php
$im = imagecreatefrompng('images/arrow.png');

imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0);
imagepng($im, 'images/arrowf.png');
imagedestroy($im);
?>


I've verified with .phpinfo(); and it seems like GD library is installed.
Could someone tell me why its not working?

Thanks
Sipphy
QUOTE(skatana @ Aug 24 2009, 01:42 AM) *
Hi,
I'm trying to use the GD Library in PHP to change the color of an image in PHP. On my local server, it works ok, but when I upload my files to my zyic website, I get the following error:

Fatal error: Call to undefined function imagefilter() in /www/uuuq.com/s/k/a/skatana/htdocs/demo/twinkling/index.php on line 221

Here is my code:

CODE
<?php
$im = imagecreatefrompng('images/arrow.png');

imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0);
imagepng($im, 'images/arrowf.png');
imagedestroy($im);
?>


I've verified with .phpinfo(); and it seems like GD library is installed.
Could someone tell me why its not working?

Thanks


I am getting the same error.
This is some of my code:

CODE
$image= imagecreatefrompng("http://sylesca.com/images/animals/cat_normal.png");
            $image= imagefilter($image, image_filter_colorize, 0, 0, 0, 127);
            imagepng($image, "animal.png");
            imagedestroy($image);


Unfortunately I'm just an amateur and I don't know anything.
ClickSSL
As per your code please check first that in images folder arrow.png is available or not ...
If image is available then try this code..
I think it may be helpful for you…

CODE
<?php
$im = @imagecreatefrompng('images/arrow.png');

if($im && @imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0))
{
    echo 'Image converted.';

    @imagepng($im, 'images/arrowf.png');
}
else
{
    echo 'Conversion failed.';
}

@imagedestroy($im);
?>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.