[Skip to main content](#vessel-content)

#   500 server error on image upload.

##

- **[donzo](/forum/user/1409-donzo "View donzo's Profile")**
- [![donzo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1409-donzo "View donzo's Profile") Topic Author
- [ Offline](/forum/user/1409-donzo)

Less More

- Posts: 74
- Thank you received: 1
-
-

14 years 5 months ago [\#50942](#50942) by [donzo](/forum/user/1409-donzo "View donzo's Profile")  *[500 server error on image upload.](/forum/3-bug-report/50942-500-server-error-on-image-upload#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).....  &quot; Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: '/home/bulletcl/public&#95;html/subdomains/scubazone/media/com&#95;hikashop/upload/accessories&#95;2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 329  Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 363 &quot;  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")* was created by *[donzo](/forum/user/1409-donzo "View donzo's Profile")*

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

- [ ![ScreenShot2012-05-21at18.22.12.png](/forum/attachment/3909) ](/forum/attachment/3909 "...at18.22.12.png") [ ](/forum/attachment/3909?download=1 "...at18.22.12.png")
- [ ![ScreenShot2012-05-21at18.22.34.png](/forum/attachment/3910) ](/forum/attachment/3910 "...at18.22.34.png") [ ](/forum/attachment/3910?download=1 "...at18.22.34.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDk0Mi01MDAtc2VydmVyLWVycm9yLW9uLWltYWdlLXVwbG9hZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#51010](#51010) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: 500 server error on image upload.](/forum/3-bug-report/50942-500-server-error-on-image-upload#51010 "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).....  &quot; Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: '/home/bulletcl/public&#95;html/subdomains/scubazone/media/com&#95;hikashop/upload/accessories&#95;2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 329  Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 363 &quot;  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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDk0Mi01MDAtc2VydmVyLWVycm9yLW9uLWltYWdlLXVwbG9hZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[donzo](/forum/user/1409-donzo "View donzo's Profile")**
- [![donzo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1409-donzo "View donzo's Profile") Topic Author
- [ Offline](/forum/user/1409-donzo)

Less More

- Posts: 74
- Thank you received: 1
-
-

14 years 5 months ago [\#51043](#51043) by [donzo](/forum/user/1409-donzo "View donzo's Profile")  Replied by *[donzo](/forum/user/1409-donzo "View donzo's Profile")* on topic *[Re: 500 server error on image upload.](/forum/3-bug-report/50942-500-server-error-on-image-upload#51043 "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).....  &quot; Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: '/home/bulletcl/public&#95;html/subdomains/scubazone/media/com&#95;hikashop/upload/accessories&#95;2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 329  Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 363 &quot;  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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDk0Mi01MDAtc2VydmVyLWVycm9yLW9uLWltYWdlLXVwbG9hZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[donzo](/forum/user/1409-donzo "View donzo's Profile")**
- [![donzo's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1409-donzo "View donzo's Profile") Topic Author
- [ Offline](/forum/user/1409-donzo)

Less More

- Posts: 74
- Thank you received: 1
-
-

14 years 5 months ago [\#51058](#51058) by [donzo](/forum/user/1409-donzo "View donzo's Profile")  Replied by *[donzo](/forum/user/1409-donzo "View donzo's Profile")* on topic *[Re: 500 server error on image upload.](/forum/3-bug-report/50942-500-server-error-on-image-upload#51058 "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).....  &quot; Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: '/home/bulletcl/public&#95;html/subdomains/scubazone/media/com&#95;hikashop/upload/accessories&#95;2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 329  Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 363 &quot;  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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDk0Mi01MDAtc2VydmVyLWVycm9yLW9uLWltYWdlLXVwbG9hZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

14 years 5 months ago [\#51181](#51181) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: 500 server error on image upload.](/forum/3-bug-report/50942-500-server-error-on-image-upload#51181 "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).....  &quot; Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: premature end of data segment in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecreatefromjpeg() &#91;function.imagecreatefromjpeg&#93;: '/home/bulletcl/public&#95;html/subdomains/scubazone/media/com&#95;hikashop/upload/accessories&#95;2019008533.jpg' is not a valid JPEG file in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 374  Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 329  Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/XXXXXXXX/public&#95;html/subdomains/scubazone/administrator/components/com&#95;hikashop/helpers/image.php on line 363 &quot;  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")*

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-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC81MDk0Mi01MDAtc2VydmVyLWVycm9yLW9uLWltYWdlLXVwbG9hZD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.052 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
