500 server error on image upload.

  • Posts: 74
  • Thank you received: 1
11 years 11 months ago #50942

Hi,

I have a strange issue where I can not upload images properly. The odd thing is that sometimes it works ok, other times it fails completely, and others it uploads the image but corrupts it, so you get part of the image and the rest is pixel noise or tiled incorrect pieces of the image.

I get this error in the category manager page where the thumbnail should be (which just turns black).....

"
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public_html/subdomains/scubazone/administrator/components/com_hikashop/helpers/image.php on line 374

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/bulletcl/public_html/subdomains/scubazone/media/com_hikashop/upload/accessories_2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public_html/subdomains/scubazone/administrator/components/com_hikashop/helpers/image.php on line 374

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public_html/subdomains/scubazone/administrator/components/com_hikashop/helpers/image.php on line 329

Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public_html/subdomains/scubazone/administrator/components/com_hikashop/helpers/image.php on line 363
"

It doesn't happen when I work locally using a MAMP server, so I guess its server. But what do I ask the hosting company to fix?

Thanks

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81633
  • Thank you received: 13085
  • MODERATOR
11 years 11 months ago #51010

It could be because of the file size and the upload size or memory restrictions in place on your hosting.
It's indeed a problem with the hosting.
You will probably have to ask them to increase them, but they might not accept. It depends on the hosting company...

Please Log in or Create an account to join the conversation.

  • Posts: 74
  • Thank you received: 1
11 years 11 months ago #51043

Hi, I did some testing and it seems that it had something to do with the jpeg encoding of the images I was uploading. I just re-saved them as quality 60 and optimised and now they upload ok.

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 74
  • Thank you received: 1
11 years 11 months ago #51058

I still can't find out why this is really happening. Some images load up ok, other don't. Even If I re-save, some don't work? Even if I copy and paste them into another document and save ?

Is there a way to purge out all the unused images from the media folder. Each attempt I make creates a new file and set of thumbnails.

Also, I have read this elsewhere, but are there any plans to have a file browser for image uploads that allows you to select an image already on the server. I have generic products that will use the same image, so I don't really want to have multiple sets of the same image, i.e. mask.jpg, then it creates mask-16527635.jpg etc.

Please Log in or Create an account to join the conversation.

  • Posts: 81633
  • Thank you received: 13085
  • MODERATOR
11 years 11 months ago #51181

The thumbnails have to be created automatically for listings. That's totally normal.
There is no need to purge them. They are deleted when you delete the images.

A file browser is in the todo list.
For now if you want to link an image to a product, you can go in the Products->Import screen and do an import from textarea with the text:

product_code,images
my_prod1,my_image.jpg

where my_prod1is the product code of your product and my_image.jpg the name of your image.

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum