Images with ] character in filename don't display properly

Video stills taken from GoPro videos are in jpg format. When members try and upload these specific images to my forum they do not Onebox or even display at all (end up as a non-clickable url).

The thing is, they work fine here.

All other images (i.e., non GoPro video stills) work on my forum just fine. Oddly enough, if I take the offending GoPro jpg and export it without making any changes (again, as a jpg) from any image editor then the same image displays just fine.

What am I missing?

Here’s a link to the screencast:

Are those very large size raw images?

354KB – well under the size cap. I can reproduce the issue at will. A couple members that have GoPro’s cannot get any jpg (from still) to work. I was happy to see that the images work fine here, and am hoping I’m just missing a plugin or something. My forum is up to date.

Is it happening here on meta or as well?

It works fine here on meta, just not on my forum.

AFAIK there is no plugin that handles oneboxing or uploads. That all is built in to discourse.
one question though! Do they not get oneboxed even after you click post/reply?

Yeah, nothing happens – the uploaded image effectively becomes just a ‘dead’ link, like this:


Looks like your filename having the ] symbol. Try again by removing it.


The file name is GP067894.jpg.

Can you provide a link so we can download a GoPro video still? I’m curious if there’s anything inherently different from other JPGs.


Sure, below is the image as uploaded to my Dropbox.

Remember, the image works fine on this forum but not on my forum, where it only shows the URL (as illustrated in the first post of this thread:

Again, to my knowledge, this only happens with jpg’s shot with a GoPro.

Is your site on latest code, like try and meta are?

Just checked 2.0.0.beta1+93

Have you rebuilt at the command line recently? You need that to get the latest container, etc. If we can’t repro this on try or meta, it’s not a bug in Discourse by definition.

Pardon my ignorance, but does that mean running this?

./launcher rebuild app


git pull beforehand, in the correct directory, but yes :wink:

All done. I also ran OS updates and upgrades, then upgraded the Droplet to the new pricing plan specs (4GB/2CPU/80GB). Unfortunately, the same issue happens when I try to upload the exact same image that was uploaded (and working) in this thread.

When trying to insert the image the result is simply a line of plain text:


I have no idea why this is happening.

It’s the extra closing square bracket, wherever that is coming from.


What closing bracket? The file name is GP067894.jpg

Not the filename, the insertion text:


Do you see the character I have marked above with the ^ caret? It is incorrect.

In the above example the filename of the image I uploaded was …


… on disk which results in


Your image, on disk, must have ] in the filename and this is causing problems:

bad filename].jpg

Perhaps this is a bug in Discourse, we should probably remove those bracket characters @vinothkannans as they are valid in filenames at least in Windows, and we are only using them for the alt text anyway.