Message not catched when uploading an image with megapixels higher than the ones permitted

(Ismael Posada Trobo) #1

Hi guys,

Not sure if someone has reported this before, but just in case. I’ve tried to upload a picture creating a new topic and clicking on Upload button, with the following data:

  • size: 8MB
  • pixels: 97

Having Discourse configured with the following settings:

  • max_image_size_kb: 4096
  • max_attachment_size_kb: 4096
  • max_image_megapixels: 40

After a while, I got the following non-human readable error:

Increasing both the size and the megapixels it works, no errors. I’ve tried with version v2.1.6 and v2.2.0.beta5.

Maybe this message should be a bit more friendly?


(Jeff Atwood) #2

This looks like an error in the underlying ImageMagick C binaries, so my guess is it is specific to that image. This is extremely unlikely to be a Discourse bug based on what you posted.

Can you duplicate this on Where can I download the source image to test with?

(Ismael Posada Trobo) #3

Hi Jeff,

Please find below a link where to download the original image from onedrive (View original and then download it, to recover the original one):

I’ve tried in and seems to work, but I dunno what are the settings set related to the size and the pixels.

Hope this helps!


(Jeff Atwood) #4

Took a while but it came across just fine on when I allowed large enough images.

So the problem is specific to your local install of Discourse, it is not a fault in the Discourse docker image or codebase.