Jump to content

Fatal error


Guest

Recommended Posts

Using CC v3... and added items with no problem.....

when i went back in to add more items several days later, I am now getting this error:

'Fatal error: Call to undefined function: imagecreatefromjpeg() in gd.inc.php on line 47'

All new images are same size as whats already on the site....

Checked permissions and everything is as it was when I originally added items to the store...

wondering what went wrong !

anyone have any ideas ??

thanks !

Link to comment
Share on other sites

Hi mate,

gd.inc.php can be found in the classes folder.

(taken from 3.0.10)

The function you mention should read:

function thumbnail($imgfile)

{

global $config;

//detect image format

$this->img["format"]=ereg_replace(".*\.(.*)$","\\1",$imgfile);

$this->img["format"]=strtoupper($this->img["format"]);

if($config['gdversion']>0){

if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {

//JPEG

$this->img["format"]="JPEG";

$this->img["src"] = ImageCreateFromJPEG ($imgfile);

} elseif ($this->img["format"]=="PNG") {

//PNG

$this->img["format"]="PNG";

$this->img["src"] = ImageCreateFromPNG ($imgfile);

} elseif ($this->img["format"]=="GIF") {

//GIF

$this->img["format"]="GIF";

$this->img["src"] = ImageCreateFromGIF ($imgfile);

} else {

//DEFAULT

echo "Not Supported File! Thumbnails can only be made from .jpg and .jpeg file types!";

exit();

}

@$this->img["width"] = imagesx($this->img["src"]);

@$this->img["height"] = imagesy($this->img["src"]);

//default quality jpeg

$this->img["quality"]=80;

} else {

return FALSE;

}

}

Give it a check, make sure it aint corrupt, or copy and paste above in its place.

Burgensteen

Link to comment
Share on other sites

Thanks.... but didn't work. I did a cut 'n paste ...tried to add a new item and got this new error message:

Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /classes/gd.inc.php on line 75

I guess its back to square 1

Thanks for the effort !

==========================================

Hi mate,

gd.inc.php can be found in the classes folder.

(taken from 3.0.10)

The function you mention should read:

function thumbnail($imgfile)

{

global $config;

//detect image format

$this->img["format"]=ereg_replace(".*\.(.*)$","\\1",$imgfile);

$this->img["format"]=strtoupper($this->img["format"]);

if($config['gdversion']>0){

if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {

//JPEG

$this->img["format"]="JPEG";

$this->img["src"] = ImageCreateFromJPEG ($imgfile);

} elseif ($this->img["format"]=="PNG") {

//PNG

$this->img["format"]="PNG";

$this->img["src"] = ImageCreateFromPNG ($imgfile);

} elseif ($this->img["format"]=="GIF") {

//GIF

$this->img["format"]="GIF";

$this->img["src"] = ImageCreateFromGIF ($imgfile);

} else {

//DEFAULT

echo "Not Supported File! Thumbnails can only be made from .jpg and .jpeg file types!";

exit();

}

@$this->img["width"] = imagesx($this->img["src"]);

@$this->img["height"] = imagesy($this->img["src"]);

//default quality jpeg

$this->img["quality"]=80;

} else {

return FALSE;

}

}

Give it a check, make sure it aint corrupt, or copy and paste above in its place.

Burgensteen

Link to comment
Share on other sites

Thanks for responding... but that didn't work either. Backed up the existing file, ran the file you sent... got this error when trying to add a new product:

Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/gonecoas/public_html/store2/classes/gd.inc.php on line 47

This is Line 47: $this->img["src"] = ImageCreateFromJPEG ($imgfile);

The crazy part about this is that I have already been adding items.... took a few days off and went back to add more and started getting all these errors when I KNOW I did nothing wrong....this is a real head-scratcher ;) This is the 5th store I have setup for various clients ~!!~

Thanks again :)

Sorry to hear it didnt work mate. :dizzy:

Attached gd.inc.php.

Try uploading to 'classes'.

But backup old file first.

(again this is from 3.0.10)

Burgensteen

Link to comment
Share on other sites

Hi Again !

Here's what I am using.....

CC v3.0.10

.jpg extensions

GD settings are:

--version 2

--Allowing GIF support=yes

--Thumbnail size=125

--Max Image Size=10000

--GD Image Quality=80

It allows me to create new products but won't allow me to include pics.

I'm about ready to tear out what little hair I have left on my head !

Thanks for all your help...its greatly appreciated :)

SS

Link to comment
Share on other sites

Hi Again !

Here's what I am using.....

CC v3.0.10

.jpg extensions

GD settings are:

--version 2

--Allowing GIF support=yes

--Thumbnail size=125

--Max Image Size=10000

--GD Image Quality=80

It allows me to create new products but won't allow me to include pics.

I'm about ready to tear out what little hair I have left on my head !

Thanks for all your help...its greatly appreciated ;)

SS

hi there,

same thing happened to me, I set GD to N/A in admin shop configuration. After that I was able to upload images.

good luck, pixeldiva

Link to comment
Share on other sites

Thanks.... that worked but its not creating the thumbnail pics....

Any suggestions ?

Thanks !

SS

Hi Again !

Here's what I am using.....

CC v3.0.10

.jpg extensions

GD settings are:

--version 2

--Allowing GIF support=yes

--Thumbnail size=125

--Max Image Size=10000

--GD Image Quality=80

It allows me to create new products but won't allow me to include pics.

I'm about ready to tear out what little hair I have left on my head !

Thanks for all your help...its greatly appreciated ;)

SS

hi there,

same thing happened to me, I set GD to N/A in admin shop configuration. After that I was able to upload images.

good luck, pixeldiva

Link to comment
Share on other sites

To all that responded to my 'fatal error' dilemma....

Thank you for your help....it is and was greatly appreciated.

I feel like a dunce..... I mistakenly blamed CC3 for a problem that was actually a blunder on my part. When doing Apache updates, I neglected to click the box that installs/activates the GD Library. As soon as I discovered my blunder, the 'fatal error' in CC3 disappeared ! All is well ;)

Thanks again for all the assistance...

Peace

SS

Link to comment
Share on other sites

I'm glad to hear that you resolved your problem and also glad to hear it was user error. Many of the problems I see can be resolved by looking at what we've done and not what Cube Cart has or has not done. Thanks for your input.

Link to comment
Share on other sites

  • 2 months later...
Guest bitemesystems

I got the same error where thumbnails weren't being created on image uploads. Here was my solution for those that are in the same situation...

I am running PHP 4.3.4. From my original PHP install package, I copied the php_gd2.dll file to my Apache server root folder (Apache 2) and in the PHP.INI file I uncommented the extension=php_gd2.dll line. Save and restart Apache server and it worked fine from then on.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...