gabriel-vasile / mimetype

A fast Golang library for media type and file extension detection, based on magic numbers
https://pkg.go.dev/github.com/gabriel-vasile/mimetype#pkg-overview
MIT License
1.6k stars 160 forks source link

Add support for JPEG XL file format #154

Closed jonsneyers closed 3 years ago

jonsneyers commented 3 years ago

1) Specify the MIME type and extension for which to add support image/jxl .jxl

2) Share an example file http://jpegxl.info/logo.jxl

3) Optionally, add a reference to the specification of the file format. ISO/IEC 18181 http://jpeg.org/jpegxl

jonsneyers commented 3 years ago

The magic is as follows: either FF 0A or 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A

gabriel-vasile commented 3 years ago

Hi, @jonsneyers

I tried looking for image/jxl in the IANA list, but it's not there. I see other JPEG formats like image/jxs and image/jxr are in the list.

Maybe image/jxl is registered under other name in the list? Let me know if you have any idea. I will use image/jxl if you don't. Thanks!

jonsneyers commented 3 years ago

It's currently still on the 'provisional' list: https://www.iana.org/assignments/provisional-standard-media-types/provisional-standard-media-types.xhtml

Might take a while before it gets moved to the main list, I don't know at what pace IANA approves new media types...