rails / marcel

Find the mime type of files, examining file, filename and declared type
Apache License 2.0
387 stars 67 forks source link

JPEG XL image variants are assigned the wrong :content_type #95

Open dkam opened 1 year ago

dkam commented 1 year ago

Steps to reproduce

Download a JXL ( EG from here )

Run Marcel::MimeType.for Pathname.new('logo.jxl') or Marcel::MimeType.for(File.read('logo.jxl'))

Expected result

The correct mime type is 'image/jxl'

Actual behaviour

The mime type 'application/octet-stream' is returned.

irb(main):022> Marcel::MimeType.for Pathname.new('logo.jxl')
=> "application/octet-stream"
Marcel::MimeType.for(File.read('logo.jxl'))
=> "application/octet-stream"
dkam commented 1 year ago

It looks like it's in Apache Tika already - I guess the tables just need regenerating and new version pushed?

I've cloned Marcel and created a branch with the updates - happy to create a pull request.

creativetags commented 1 month ago

Would love to see this merged