Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Post History

81%
+7 −0
Q&A Serve images with file extensions

I've noticed that images uploaded to Codidact don't retain any meta information. That is, they don't keep either the name of the image or the image extension. While the former isn't that bad (alt t...

0 answers  ·  posted 4y ago by Moshi‭

#1: Initial revision by user avatar Moshi‭ · 2020-09-16T21:03:51Z (over 4 years ago)
Serve images with file extensions
I've noticed that images uploaded to Codidact don't retain any meta information. That is, they don't keep either the name of the image or the image extension.

While the former isn't that bad (alt text or just plain explanation is probably better if information about the image is needed), the latter is troubling. There is no way to know what the type of the image is, whether it's a png, jpg, or other.

Browsers are able to guess the extension and *display* the image, but when it comes to saving, Edge and Chrome will only offer the name the site gives the image - that is, without an extension. Firefox can automatically add the extension it guessed to the file name when saving, but either way, I don't think the site should rely on browsers needing to guess the image extension.

Thus, I suggest either

 - The entire image name is saved. If name collisions are a problem, you can keep the hash thing in the URL, ex. `.../9FJw5ge4D2CAh2NsTz3iPF3U/<image name>.png`
 - The extension is saved (so `.../9FJw5ge4D2CAh2NsTz3iPF3U.png`)