Jump to content

[SOLVED] Going crazy ! Help... Graphics problem


coderage

Recommended Posts

Graphics with php is driving me crazy now. plz help im new to this .

When i try to execute the following code or any other graphics code i get "Undefined function " error message, i have php_exif.dll, php_gd2.dll , php_imagick.dll in my php extensions folder

 

<?

Header("Content-type: image/jpeg");

$im = imagecreatefromjpeg("./test.jpg");

Imagejpeg($im,'',20);

ImageDestroy($im);

?>

 

 

<br />

<b>Fatal error</b>:  Call to undefined function imagecreatefromjpeg() in <b>D:\www\jpgimage.php</b> on line <b>3</b><br />

 

 

Using Win Xp, iis 5.1, PHP 5.2.1

Link to comment
https://forums.phpfreaks.com/topic/47217-solved-going-crazy-help-graphics-problem/
Share on other sites

Check your php.ini file (phpinfo() will give location of the on it is using) and make sure

 

extensions folder is defined as expected (ie c:/php/extensions)

 

and that the ; has been removed from the line

 

;extension=php_gd2.dll

This problem is solved, thanks to Barnard and all the folks who helped me,

The problem was

1- The php installation needed a Repair.

2- My stupidity, i was using "jpg" instead of "jpeg" in function names, it makes the whole difference.

3- You need to have two image variables one to allocate a free canvas ex $img1=imagecreate 

    ($height,$width) and $img2. Where $img2 gets the image from func: imagecopy(parameters).  Plz

    correct if this is wrong.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.