Clickable images in Discourse

I’ve noticed that when I post comments with images (typically screenshots), the images are usually rendered as a clickable object, where clicking on it expands the image to maximum size (within the limits of the browser window), including links to download or view the original image.

But not always. Sometimes, an image just appears as an image without the clickable-object features. If it’s rendered too small to be easily visible, you have to tell your browser to do something like open the image in a new tab in order to view it at full size.

For an example, in this comment I just posted (Sophisticated attempt to breach security - #12 by Shamino), three of the four images are rendered as clickable objects, but one of them (the third one) isn’t.

Sometimes, if I delete an image and re-upload it, it will work the second time around, but not always.

I would assume this is a bug in Discourse, but I really can’t be sure. Have you also seen this?

1 Like

It is related to the pixel size of the image. The dimensions of the third one are below the threshold.

You can manually adjust the markup to make it clickable. See https://meta.discourse.org/t/default-image-size-in-posts/235465/4 (Meta Discourse is their official support forum)

1 Like

Thanks! I haven’t changed from the defaults of max-image-width of 690 and max-image-height of 500. Is there an argument for adjusting those?

I don’t think so. It’s a side-effect of my usage. The image in question is 640x281. But I requested it to be presented at 50% size, to not detract from the surrounding text.

When Discourse auto-resizes an image, you get the ability to click on it to view the full-size image. But when you request that it be resized (as I did), that link doesn’t appear, so a user who wants to see the original full-size image needs to use his browser’s view-image mechanism to do so.

I’m not sure if this should be considered a bug or a feature request.