Jump to content

imagejpeg() problem


Guest peppy

Recommended Posts

Hey,

I keep getting messages like this whan i upload an image...

I checked all topics here but i dont get it anymore.

Can someone please help me ?

Warning: imagejpeg(): Unable to access /var/www/vhosts/grotesokken.nl/httpdocs/images/uploads/thumbs/thumb_IM000015.JPG in /var/www/vhosts/grotesokken.nl/httpdocs/classes/gd.inc.php on line 296

Warning: imagejpeg(): Invalid filename '/var/www/vhosts/grotesokken.nl/httpdocs/images/uploads/thumbs/thumb_IM000015.JPG' in /var/www/vhosts/grotesokken.nl/httpdocs/classes/gd.inc.php on line 296

this is the code:

	function save($save="")

	{

		global $config;

		

		if ($config['gdversion']==2)

		{

			$this->img["des"] = imagecreatetruecolor($this->img["width_thumb"],$this->img["height_thumb"]);

			@imagecopyresampled ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["width_thumb"], $this->img["height_thumb"], $this->img["width"], $this->img["height"]);

		

		} 

		elseif ($config['gdversion']==1)

		{

		

			$this->img["des"] = imagecreate($this->img["width_thumb"],$this->img["height_thumb"]);

			@imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["width_thumb"], $this->img["height_thumb"], $this->img["width"], $this->img["height"]);

		}

 		

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

		{

		

			// fix for base restriction error

			/*

			$fh = fopen($this->img["des"],'w');

			fclose($fh);

			*/

		

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

			{

				//JPEG

				imagejpeg($this->img["des"],$save,$this->img["quality"]);

				

			}

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

			{

				//PNG

				imagepng($this->img["des"],$save);

				

			}

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

			{

				//GIF

				imagegif($this->img["des"],$save);

				

			}

			imagedestroy($this->img["des"]);

			@chmod($this->img["des"], 0644);

			

		}

	

	}

the whole function with the error.

Pepijn Gottschal

Link to comment
Share on other sites

chmod 777 your /images/uploads and /images/uploads/thumbs folders

I chmodded it all to 777,

i started uploading again and now i get:

Warning: imagejpeg(): Unable to access /var/www/vhosts/grotesokken.nl/httpdocs/images/uploads/thumbs/thumb_sneakersok_rwb.JPG in /var/www/vhosts/grotesokken.nl/httpdocs/classes/gd.inc.php on line 296

Warning: imagejpeg(): Invalid filename '/var/www/vhosts/grotesokken.nl/httpdocs/images/uploads/thumbs/thumb_sneakersok_rwb.JPG' in /var/www/vhosts/grotesokken.nl/httpdocs/classes/gd.inc.php on line 296

I think that was the

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

			{

				//JPEG

				imagejpeg($this->img["des"],$save,$this->img["quality"]);

				

			}

part...

What now ? ;)

Link to comment
Share on other sites

I shall check it again...

PHPinfo:

gd

GD Support enabled

GD Version bundled (2.0.28 compatible)

FreeType Support enabled

FreeType Linkage with freetype

GIF Read Support enabled

GIF Create Support enabled

JPG Support enabled

PNG Support enabled

WBMP Support enabled

XBM Support enable

in the setting of cubecart i have the following information:

2

Yes

75

390

80

I just tried it again and get the same message...

Link to comment
Share on other sites

something with GD,

i just made in photoshop thumbnails from the origional pics and looked at other site's how the thubs are called.

like if your photo called 'sock' then the thumb must be 'thumb_sock'.

and that's how i solved it */*

Link to comment
Share on other sites

Guest alholloway

Hi

I'm trying upload product pictures and although the show up on the detailed description there's no thumbnail. And, in fact, sometimes when I try to upload a jpg, I get this error. do you have any advice..?

Fatal error: Call to undefined function: imagecreatefromjpeg() in e:\domains\t\turtlemouth.co.uk\user\htdocs\classes\gd.inc.php on line 49

Link to comment
Share on other sites

Hi

I'm trying upload product pictures and although the show up on the detailed description there's no thumbnail. And, in fact, sometimes when I try to upload a jpg, I get this error. do you have any advice..?

Fatal error: Call to undefined function: imagecreatefromjpeg() in e:\domains\t\turtlemouth.co.uk\user\htdocs\classes\gd.inc.php on line 49

Fought same problem. Changing server hosting companies was my solution...But look at this link:

http://www.cubecart.com/site/forums/index....amp;#entry95905

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