×
Kunena 5.1.18 Released (30 Jun 2020)

The Kunena team has announce the arrival of Kunena 5.1.18 [K 5.1.18] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1.

× Topics that are moved into this category are generally considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Solved image attachment size calculation error in K2.0.1

More
8 years 2 weeks ago #1 by derekf
Hi there,

I am now running Kunena 2.0.1 and am having a problem with attaching images.

I've got the max image size set to 105kb and the maximum file size set to 5242kb, but if I try to upload a 64k PNG image file (properties show 64,935 bytes), Kunena gives a an error message that says:

Failed to upload file '64k image.png': The file size (279955) exceeds the maximum set by the administrator.

The image is 807 x 500 pixels which exceeds the 800 x 800 limit I've got set and if I change the image to be fit the pixel width then I don't get the error.

It looks like the bug is in the display of the reason why the file can't be uploaded.

Any ideas what the problem is?

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

More
8 years 2 weeks ago #2 by sozzled

derekf wrote: The image is 807 x 500 pixels which exceeds the 800 x 800 limit I've got set and if I change the image to be fit the pixel width then I don't get the error.

As you say, if you resize the image you don't get the problem. So I don't understand the question. If you want to allow dimensionally larger images, then increase the width/height dimensions in your configuration settings.

Does that help?

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

More
8 years 2 weeks ago #3 by derekf
Sozzled - I've done that as a workaround - however it is definitely a bug.

If the problem is that it is due to size then the message saying it is due to size is appropriate, but it should display the correct size of the image being uploaded

If the problem is due to pixel dimensions, then the error message should say this and not that it is size (as it is misleading and confusing to users)

Finally, and MUCH more importantly, in the Kunena configuration where you set the pixel width and height, it says that larger images will still be uploaded but will be resized to this. This is exactly what we want but is not happening...

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

More
8 years 2 weeks ago #4 by derekf
Hi there,

Any update on this and is it possible to move the thread into the Support forum as this looks like a bug...

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

More
8 years 2 weeks ago - 8 years 2 weeks ago #5 by sozzled

derekf wrote: Failed to upload file '64k image.png': The file size (279955) exceeds the maximum set by the administrator.

You stated that the maximum file size (that you allow for image uploads) is 105 Kb. The image you were trying to upload was 273 Kb. You cannot upload an image that is 273 Kb if you have set the maximum file size of 105 Kb.

The error message seems to be unrelated to the configuration settings relating to image width and height but more about the file size (in bytes) of an image you are trying to upload. I have no first-hand knowledge (of course) of the "64 Kb" file you claim you are trying to upload but this is the formula used to determine file size and express the result in Kbytes:

File size = (horizontal pixels × vertical pixels × bit depth) / (8 × 1024)


Therefore, one needs to know the number of bits per pixel you are using to store colour information in order to properly calculate the file size. Assuming that file of 807 x 500 px is 64 Kb, this means the file uses no more than 6 bits per pixel (giving a maximum possible 64 colours). Is that correct? Thus, before we can properly classify this as a bug, we need to know more about the file that you say is "64 Kb" file and why PHP "thinks" it's actually 273 Kb. :unsure:
Last edit: 8 years 2 weeks ago by sozzled.

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

More
8 years 2 weeks ago #6 by derekf
Please find attached file that I'm having the problem with.


Attachments:

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

More
8 years 2 weeks ago #7 by derekf
Hmmm - image displayed inline so have renamed to .pdf to see if it will attach it instead

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

More
8 years 2 weeks ago #8 by derekf
That didn't seem to work - I take it you'll be able to see the attachment in attachment manager though.

Many thanks for looking into this for me...

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

More
8 years 2 weeks ago - 8 years 2 weeks ago #9 by sozzled
The image you posted (807 x 500 px) was resized to 715 x 443 px.

The maximum width/height restrictions in the configuration settings on this site are:

Forum Configuration » Uploads » Images »
Maximum Image File Size: greater than 64 but you don't need to know the actual figure ;)
Maximum Image Width: 1024
Maximum Image Height: 1024

The reason why the image was resized is because of another configuration setting:

Forum Configuration » Frontend » Look and Feel »
Textarea Width: 740

The reason why dynamic image resizing works on this site is because there is a dynamic image processing library installed with PHP (which is fairly standard for most hosted installations these days).

Perhaps the information that accompanies the forum configuration settings could be improved but, in your case, simple problem, simple remedy: increase the configuration setting values to allow for bigger (or resize your images yourself so that they're within the boundaries you've defined).

If you believe you have a problem with dynamically resizing images, post your configuration settings.

Please let us know if the advice we have given resolves the matter for you.
Last edit: 8 years 2 weeks ago by sozzled.

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

More
8 years 2 weeks ago #10 by derekf
Hi there - that really helps, but I'm still a bit confused.

I modified the Max image width and Max image height to 1024 (from 800) and left the textarea width and height as 450 and 300 respectively.

The image was uploaded and looks to be resized when it is displayed, but when I download it it's still saved as the 807 x 500 size.

Am I wrong in the assumption that if the image width and height settings are set to 800 that they should be resized (as the text to the right of these settings say)?

If the files are supposed to be resized _based on the settings in Configuration -> Uploads -> Images_ then what do I need to have installed on the server to support this?

Thanks again...

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

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.317 seconds