Page 1 of 1

imagecreatefrompng() proplem

Posted: Tue Jun 28, 2005 3:20 pm
by icarpenter
I am using PHP 4.3.10 and I am trying to call the system function

Code: Select all

imagecreatefrompng('mypng.png')
I get the following error:-

Fatal error: Call to undefined function: imagecreatefrompng()

Has anyone come accross this error before?

Thanks Ian

Posted: Tue Jun 28, 2005 3:55 pm
by tuanfishy
Try looking at http://ca.php.net/imagecreatefrompng it might help.

This is was an example on that site:
$imgPng = imageCreateFromPng($strImagePath);

Posted: Tue Jun 28, 2005 4:31 pm
by Revan
GD isn't loaded?

Posted: Tue Jun 28, 2005 4:34 pm
by icarpenter
I didn't think it had to be if you are running PHP 4.3.10!

Do I have to enable something in PHP.ini?

Posted: Wed Jun 29, 2005 10:06 am
by pickle
GD needs to be compiled in. Failing that, you can dl() the extension during runtime. To see if it's compiled in, just call phpinfo() and there should be a GD section in the resulting page, if it is compiled in.

imagecreatefrompng()

Posted: Thu Jun 30, 2005 4:42 pm
by icarpenter
Thats got it Thanks Pickle!!!

For those who are interested....

The php_gd2.dll was not installed I had to copy this to C:\windows\sytem32 and remove the ';' in th PHP.ini file that preceeds the php_gd2.dll...


It might be worth noting that the extensions folder with loads of .Dll files in PHP version 4.3.10 does not download automatically using the installer...

Rgds Ian.