Errors

I am getting an error message when I upload a JPG file image on the cscart 2.
It says there is an error in the core fn.images.php line 889 

For jpeg the code is this

	case 'jpg':
				$new_filename .= '.jpg';
				imagejpeg($dst, $new_filename, $gd_settings['jpeg_quality']);
				break;

I changed the image to .png and there was no problem. The code for that follows

case 'png':

				$new_filename .= '.png';
				imagepng($dst, $new_filename);
				break;

The code for .gif is similar to the .png.

Of course the easy answer is to use the .png but that would be a lot of work if I have to .

Can anyone tell me if the code for .jpeg is ok or has to be changed.

Thank you.

Post the error message

Warning: imagejpeg() [function.imagejpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/primequa/public_html/core/fn.images.php on line 889

View larger image

This is the result adding a jpeg and previewing as admin
thank you.

I don't think it's a problem with the code but rather a problem with the image or your settings or how you are uploading them.

What is the size of the original image uploaded? Your server config may not allow file uploads over a certain size.

I checked your site and something is strange about the image paths. Your thumbnails and detailed images are both in the /images/thumbnails/ directory. Thumbnails should be in thumbnails and detailed images should be in detailed images.

How are you uploading the images?

Tool-

How are you able to see anything about my image paths. Exactly how are you able to "check my site"

Tool-

How are you able to see anything about my image paths. Exactly how are you able to "check my site"

URL of your website can be found in your message. Images path are checked in the source code of the page

Regarding the error, please check the following page

https://stackoverflow.com/questions/10611883/warning-imagejpeg-functionimagejpeg-gd-jpeg-jpeg-library-reports-unrecov

Tool-

How are you able to see anything about my image paths. Exactly how are you able to "check my site"

The image paths are in the source code of your pages. One can also download the image and see in more detail things like dimensions, etc.

Ok. I see what you are talking about. I upload files (.jpg) from my home computer files, after editing the photos in a photo editing program. I have been doing this for 8 years and never ran into this problem. When I start to add a product I go to the category page and add the product from there.I then upload the image file onto that page. Is there another way?

Are you entering your images on the main page of the products.update page? Or are you using the 'Images' tab? The images tab is meant for alternate images. The main image should be uploaded on the main page.

If you are getting an error on the processing of the image (as your OP shows) then there is either a problem with your source image (most likely) or a problem with the PHP image libraries on your server. Best to ensure your site has the imagik extension installed. Cs-cart will then use those libraries rather than the GD libraries.

Not clear who you are responding to (Tool or me) since you don't use "quote" in your response.

EZ I have peen uploading the photgraph to the main products page. The problem comes when I try to view the page with the admin viewer.

The live page seems to be ok, I will check the PHP image libraries. Is it possible that the admin viewer is the problem?

Thanks for your help.

Anything's possible. What do you mean by the "admin viewer"? Are you talking about the large thumbnail that is displayed on the products.update page where you can download a new image? You might want to verify that the image is proper on other customer pages (other than the main product page) so you can see if the resizing of your original image is actually working properly (I.e. listing pages).

EZ I am talking about the "preview as admin" button on the products update page. I have just had the imagick extensions enabled. I'll see how that goes. Thanks for your help

the "preview menu item" from admin should behave exactly like the products.details page in the customer view.

EZ-Thank you