Page 1 of 1

fatal error: Unidentified function: imagecolorallocate()

Posted: Fri Jun 06, 2008 11:41 am
by jj_bate
I am getting this fatal error when i use this function:
imagecolorallocate()

does it have to do with my GD version?

Heres the GD info ( using var_dump(gd_info()); )
["GD Version"]=> "bundled (2.0.34 compatible)"

["FreeType Support"]=> bool(true)
["FreeType Linkage"]=> "with freetype"
["T1Lib Support"]=> bool(false)
["GIF Read Support"]=> bool(true)
["GIF Create Support"]=> bool(true)
["JPG Support"]=> bool(true)
"PNG Support"]=> bool(true)
["WBMP Support"]=> bool(true)
["XPM Support"]=> bool(false)
["XBM Support"]=> bool(true)
["JIS-mapped Japanese Font Support"]=> bool(false) }


Am i missing something?

Re: fatal error: Undefined function: imagecolorallocate()

Posted: Fri Jun 06, 2008 11:52 am
by jj_bate
i meant to type undefined, not unidentified... :roll:

Re: fatal error: Unidentified function: imagecolorallocate()

Posted: Fri Jun 06, 2008 11:54 am
by dbemowsk
Post your code and the exact error you are getting.

Re: fatal error: Unidentified function: imagecolorallocate()

Posted: Fri Jun 06, 2008 12:00 pm
by jj_bate
Fatal error: Call to undefined function imagecolorallocate() in .../generateTrans.php on line 12

<?php

var_dump(gd_info());

$file = "test123.png";

$imagesource = "$file";
$image = imagecreatefrompng($imagesource);

if (!$image) die();

$trans = imageColorAllocate($image, 100, 100, 100);


imageColorTransparent($image, $trans);

imagepng($image, "testing123.png");
imagedestroy($image);

?>

Re: fatal error: Unidentified function: imagecolorallocate()

Posted: Fri Jun 06, 2008 12:10 pm
by helraizer
jj_bate wrote:Fatal error: Call to undefined function imagecolorallocate() in .../generateTrans.php on line 12

<?php

var_dump(gd_info());

$file = "test123.png";

$imagesource = "$file";
$image = imagecreatefrompng($imagesource);

if (!$image) die();

$trans = imageColorAllocate($image, 100, 100, 100);


imageColorTransparent($image, $trans);

imagepng($image, "testing123.png");
imagedestroy($image);

?>
if you have access to it, check to see if the gd extension is uncommented in php.ini - if it's commented then uncomment it and restart apache/the server.