I recently uploaded (using discourse 2.4.0.beta7 and current) two content‑identical files in PNG and PDF formats (to the openmod forum). Discourse automatically parses and records the originating filename in the markdown as follows:
Uploaded file name
Indicated file
Comment
bridge-2-a5-flier.04.png
04
annotated 1
bridge-2-a5-flier.04.pdf
bridge-2-a5-flier.04.pdf
annotated 2
Below is a screenshot, annotated “1” and “2” to indicate how this works:
It seems to me that the PNG case should record the original filename or, failing that, at least the entire stub as per: basename "bridge-2-a5-flier.04.png" ".png".
I looked around for similar bug reports but could only find traffic regarding the generation of the anonymized name string.
I’ve taken a look and it’s definitely a bug based on . in the filename. The composer is trying to just remove the extension so we end up with bridge-2-a5-flier.04|WIDTHxHEIGHT in the markdown, but it is just splitting the filename on the . and taking the first part of the file before the extension, which is obviously not correct.
From what I can see this bug has been present for two years, so thank you for being -eyed and picking it up! I will push a fix today.