Pasted image upload size error

javascript

(Dean Taylor) #1

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


(Jeff Atwood) #2

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!


(Dean Taylor) #3

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”.


(Jeff Atwood) #4

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


(Régis Hanol) #5

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

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


(Régis Hanol) #6