hey im getting this error:
Parse error: syntax error, unexpected T_VARIABLE ...[]... on line 25:
...
$imagesource = "$file";
$image = imagecreatefrompng($imagesource);
if (!$image) die();
$trans = imagecolorallocate($image, 100, 100, 100);
imagecolortransparent($image, $trans); <---this is line 25
imagepng($image, "test.png");
imagedestroy($image);
For some reason this error comes up when imagecolortransparent($image, $trans); is used
typically its usually a missing semicolon, but not this time...
im at a loss.
totally unexplained T_variable error
Moderator: General Moderators
Re: totally unexplained T_variable error
Can you post the entire script?
Re: totally unexplained T_variable error
Alright, i dont know what i did, (must have had a bad comma) cause its not giving me that error anymore, however it is giving me this now:
Fatal error: Call to undefined function imagecolorallocate() in ...[]... on line 22
Fatal error: Call to undefined function imagecolorallocate() in ...[]... on line 22
Re: totally unexplained T_variable error
Make sure you have the correct GD version, or GD installed and uncommented in php.inijj_bate wrote:Alright, i dont know what i did, (must have had a bad comma) cause its not giving me that error anymore, however it is giving me this now:
Fatal error: Call to undefined function imagecolorallocate() in ...[]... on line 22
or make a new file with this:
<?php
var_dump(gd_info());
?>
That'll tell you your GD version and all details.
Re: totally unexplained T_variable error
checked that out a bit ago:
array(12) { ["GD Version"]=> string(27) "bundled (2.0.34 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "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) }
array(12) { ["GD Version"]=> string(27) "bundled (2.0.34 compatible)" ["FreeType Support"]=> bool(true) ["FreeType Linkage"]=> string(13) "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) }
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: totally unexplained T_variable error
Can you all please use some bbCode when posting code in the forums? It is there to make reading your code easier. It is simple to use. Just highlight your code and then click the little CODE button in the menu above the text area.