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?
fatal error: Unidentified function: imagecolorallocate()
Moderator: General Moderators
Re: fatal error: Undefined function: imagecolorallocate()
i meant to type undefined, not unidentified... 
Re: fatal error: Unidentified function: imagecolorallocate()
Post your code and the exact error you are getting.
Re: fatal error: Unidentified function: imagecolorallocate()
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);
?>
<?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()
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.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);
?>