Non-threaded

Forums » Feature Wishing Well » Read Thread

Suggestions for improvements and additions to the site.
This feature was rejected 8/19/2019: Low quality for right now.

MIME Types for User-Uploaded Images

6 years ago

User-uploaded images are served extensionless. Because of this, the server likely isn't able to provide the browser the correct media type for a given image, and instead defaults to a generic binary format (effectively forcing a "save as" dialog).

Many file formats—JPEG, GIF, and PNG included—each have their own signatures/"magic numbers", meaning that with many files it's possible to deduce media type by reading the first few bits. CYS actually already performs a check like this to prevent uploading unsupported images. So what I'm proposing is storing and serving this media type along with each uploaded image so browsers treat them as they should.