Open G2G2G2G opened 3 years ago
This probably won't be fixed in upstream dependencies as we use a patched version of https://pkg.go.dev/net/http#DetectContentType, which only implements an unmaintained spec.
Scratch that, it should be supported in upcoming go 1.17
Scratch that too, this detection is based on file extension, which we currently ignore.
Here's some go code that (incorrectly) adds avif support: https://github.com/gabriel-vasile/mimetype/pull/160 Maybe we could just use that lib
You're opening each file to read it's type for how you treat in the browser?
animated.avif: ISO Media, AVIF Image Sequence
still.avif: ISO Media, AVIF Image
AVIF support was added in https://github.com/gabriel-vasile/mimetype/pull/210
I don't see any mention of them so throwing it out there since browser support is coming faster than any other formats that ever existed. When you view a jxl or avif it currently says: Binary file not shown. For now a setting in the app.ini file would make sense I guess to allow them to be previews for whoever has it enabled.
All major browsers can now be enabled / already ship with it enabled. Jpeg XL thumbs (.jxl) Mime type: image/jxl https://caniuse.com/jpegxl
AVIF (AV1's image from the Alliance for Open Media)
Mime type: image/avif https://caniuse.com/avif