Jump to content

more questions re: call to undefined function


Guest reb_76

Recommended Posts

Guest reb_76

I created a store for a client.

(http://naturekiddos.com)

The store was fully functional. GD was enabled, version 2.

The client began using the store.

She put some items on sale.

When she decided to change the items back to full price, the store began generating a 'call to undefined function' fatal error.

I disabled the GD settings, as per the help topic here.

It no longer generates a fatal error.

It also no longer generates thumbnails in the store, although it does in the admin section.

Even though I've utilized search, I can not find

A: what takes a fully functional store and changes to a fatal error simply by taking an item off sale

B: why fixing the fatal error means no images show up in the customer side of the store.

All help is appreciated!

Link to comment
Share on other sites

Guest reb_76

I talked to the server owner - no changes have been made on the server since I uploaded the store, and no changes have been made to the source code.

the *only* thing that changed was making an item be on sale, then editing the item.

is this a CubeCart bug?

Link to comment
Share on other sites

It sounds like it may be, but I'm unfamiliar with the issue. What was the error message? It would tell you the name of the undefined function. That is where the problem lies, I suppose.

Disabling GD would mean that no thumbs will be created automatically, simple as that.

I'm sure someone will correct me if I'm wrong, IMO you need to RESTORE the GD settings, if you still get the error, copy down the entire error. Find out where the actual cause of this error is and correct the code. Disabling GD is not the answer; it may have been offered as a way to get the store back online temporarily, but that is not a solution.

Link to comment
Share on other sites

Guest reb_76

Thanks for the reply, Mark!

Here's my original thread with this:

original post

Fatal error: Call to undefined function ImageCreateFromJPEG() in /home/natureki/public_html/store/classes/gd.inc.php on line 47

Believe it or not, the help desk's solution was to disable GD :w00t:

Like I said, everything was working fine - and is still working on the products that weren't on sale.

Link to comment
Share on other sites

Guest reb_76

here's the applicable code - are there any problems with it that you can see?

class thumbnail

{

		var $img;



		function thumbnail($imgfile="",$width="",$height="")

		{

				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!";

								exit();

						}



						if($width>0 && $height>0)

						{

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...