Images with ] character in filename don't display properly


#1

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:


(Bhanu Sharma) #2

Are those very large size raw images?


#3

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.


(Bhanu Sharma) #4

Is it happening here on meta or try.discourse.org as well?


#5

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


(Bhanu Sharma) #6

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?


#7

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

![09]|690x388](upload://uzG6vZHkaFDx5K44ci8JKxqweZX.jpg)


(Vinoth Kannan) #8

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


#9

The file name is GP067894.jpg.


(Kris) #10

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.


#11

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.


(Jeff Atwood) #12

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


#13

Just checked 2.0.0.beta1+93


(Jeff Atwood) #14

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.


#15

Pardon my ignorance, but does that mean running this?

./launcher rebuild app


(Jeff Atwood) #16

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


#17

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:

![31]|690x387](upload://nAo0GVB2DXSk484vgstfhPG1BQv.jpg)

I have no idea why this is happening.


(Mittineague) #18

It’s the extra closing square bracket, wherever that is coming from.
![31|690x387](upload://nAo0GVB2DXSk484vgstfhPG1BQv.jpg)


#19

What closing bracket? The file name is GP067894.jpg


(Jeff Atwood) #20

Not the filename, the insertion text:

![31]|690x387](upload://nAo0GVB2DXSk484vgstfhPG1BQv.jpg)
----^

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 …

http-error-404-not-found.jpg

… on disk which results in

![http-error-404-not-found|499x499](upload://jw2BCroZfVX1dZChRVVvApQAjrh.jpg)

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.