Pasted image upload size error

When pasting an image from the clipboard in Windows the following error can be seen

The same image saved as a PNG file (larger than 1024kb) and then uploaded uploads without error.

You can try it for yourself.

  1. Download the full-size original version of this image and save it to disk
  2. Open in Microsoft Paint (the original one)
  3. Select all
  4. Copy to clipboard
  5. Attempt to paste into Discourse Composer

Doubtful this is a bug, probably dependent on the PNG encoding.

Try using PNGOUT, or converting to 8 bit PNGOUT, to see some of the differences. And PNGOUT is lossless!

The key point here is that the upload limit for images is higher than 1MB…

… this upload limit error appears to be the default for “attachments”.

Oh I see. @zogstrip can you have a look?

Thanks @DeanMarkTaylor for the detailed report! It’s now fixed :frog:

https://github.com/discourse/discourse/commit/e6f849f87301ef17b5eb20a781a9ac4f1d6cbbfa

3 Likes