blog

archives

Improved Image Handling

Jeff Atwood July 5, 2013

Although Discourse is open source discussion software designed around the fundamental concept of paragraphs, there is no denying that in this era of pervasive broadband, online discussions are as much about images and videos now as they are about words.

With Discourse, we wanted to make it as easy to post a picture as a paragraph. We had good support for images at launch:

  • You can drag and drop images (yes, more than one, even) into the composer.
  • You can paste images into the composer using command+v or ctrl+v*
  • You can paste a link to an image into the composer, on a line by itself. We automatically onebox the image and make it show up in your post.
  • You can use the image upload button on the composer toolbar.

But our image support was mostly designed for small images that fit in the discussion. If some user uploaded a giant image, or pasted a link to a giant image, everyone had to suffer through downloading that massive image – and there was no convenient way to see the image in larger size. Furthermore, forum owners could be on the hook for potentially massive bandwidth bills if a topic containing a few huge images got extremely popular.

Well, no longer! Through the contributions of the amazing ZogStriP, Discourse now has outstanding, comprehensive, and automatic thumbnailing support for images.

Now if you paste in a link to a giant image …

You’ll automatically get a proper discussion-sized thumbnail for that massive image rather than, well, a massive image.

We also show metadata for thumbnailed images in an overlay at the bottom when you hover over them – so you know how big an image you’re dealing with, and what the file size is if you want to download it. It’s also a hint that clicking the image will lightbox it and display it as large as your browser will allow.

Copying and pasting images from the clipboard*, even enormous images, works the same sane and safe way.

Because our image handling for large images is so much better now, we upped the default maximum image upload size from 1 MB to 2 MB. We feel that Discourse now has some of the best default image handling of any community discussion software out there. Did we mention that Discourse is completely open source and free to the world, forever?

Feel free to play with any of this new functionality (which is now enabled by default in all Discourse installs) in our sandbox at try.discourse.org!

* You can only paste in images if you are using Google Chrome. We really, really wanted to get this working on Firefox but were unable to without madness.

Start the discussion at meta.discourse.org