149 Posts
MtnPavlas
10 years ago
2
Topic
Is this a bug? When certain images are uploaded (not sure if they're somehow corrupted or something; they are of the permitted extension - jpg, and are under the allowed size limit), the image is stored in the images folder and the subsequent thumb folders but:
  1. The image is broken - so it seems that just a file shell for the uploaded image is created but it actually does not contain anything
  2. Get the following error (repeated 8 times) when viewing a list that contains a content item with this image, and when viewing the content: Warning: Division by zero in <hosting account>/public_html/plugins/cck_field/upload_image/upload_image.php on line 681
Thanks a lot for any help.
Get a VIP membership
175 Posts
webcastor
10 years ago
0
Level 1
For some reason your code can't get the proper image height, and it defaults to 0.
Have you checked if your image is referenced properly in the database. Sometimes it happen that the field is not long enough, and in the case of JSON and Custom storage, field content is much longer than what is the actual length of image name.
149 Posts
MtnPavlas
10 years ago
0
Level 1
Thank you for your reply. I am actually using the Seblod out-of-the-box User Avatar field. The stored string is fairly short (images/members/20130622_082829.jpg) and the d/b field type is set as varchar(255) ... was that way OOTB, I did not change it. If I upload a different image with the same name length, it works just fine ... it's just once-in-a-blue-moon situation but when it does happen, Seblod inserts those annoying errors on the user rendered page.

Seblod team, please consider trapping the error and displaying a user-friendly message. E.g. "There appears to be a problem with your uploaded image - please upload a new one." Even better, is there a way to inspect the image prior to saving the form and if something is wrong, keep the form open and display an error to select a different image? This is also true if the image size is bigger than allowed. The form saves and then the error is displayed... at that point, the user has no chance of correcting it because their account has not yet been activated.

Thank you for the considerations and also if there's an idea or two around how I could prevent the error described in the original post, that would be awesome. Thanks a lot, P
Get a Book for SEBLOD