Fatal Error using imagecreatefromjpeg( )

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
mcccy005
Forum Contributor
Posts: 123
Joined: Sun May 28, 2006 7:08 pm

Fatal Error using imagecreatefromjpeg( )

Post by mcccy005 »

Ok, so I keep getting the abovementioned error all the time.
I'm not sure if GD is even installed properly. I've placed php_gd2.dll into the correct extensions directory and I've uncommented the line in the php.ini file so that extension=php_gd2.dll is read by php.
When I look at phpinfo( ), the only evidence of GD being anywhere is here at the top of the HTML page:
Configure Command cscript /nologo configure.js "--enable-snapshot-build" "--with-gd=shared"
There's no other listing of GD anywhere in the phpinfo page so I have no idea what else to do. I've tried manually loading the extension using dl( ) but it won't allow me to do that either.

I'm using PHP 5.1 on Microsoft IIS 5.1 (on Microsoft Windows XP O/S).
And this is the code where the error is occurring (although I'm assuming it's a problem with GD not loading):

Code: Select all

/*Creates a thumbnail version of the image */
if($_FILES[$this->field_name]["type"][$key]=='image/pjpeg'
     || $_FILES[$this->field_name]["type"][$key]=='image/jpeg'
     || $_FILES[$this->field_name]["type"][$key]=='image/JPG')
{
    $img=imagecreatefromjpeg($_FILES[$this->field_name]['tmp_name'][$key]);
}
Post Reply