Open evenreven opened 11 months ago
To rule out upstream issues, I tried using Dragonfly on a barebones Rails 7 app without Refinery now, and although it doesn't work out of the box (it says octet-stream), it's as easy as adding mime_type "webp", "image/webp"
in the configure block of config/initializers/dragonfly.rb
as suggested here.
It's not an apples to apples comparison (because it's a Rails 7 app), but still it makes me believe Dragonfly just doesn't see the mime_type Refinery tries to add.
Any help/pointers would be very welcome!
Context: it seems
image/webp
is not part of the standard hash of extensions to mime types in Dragonfly, and browsers read the content type as "octet-stream".Dragonfly.app.mime_types
in the Rails console returns everything under the sun exceptimage/webp
. So whitelisting it in the refinery initializers doesn't work because Dragonfly won't find it to begin with (change the extension to almost anything else, and it will work).I assume it's this issue that the array of additional mime type in the initializer (
config/initializers/refinery/dragonfly.rb
) is meant to solve?But I can't find a way to register mime types that will actually be picked up by refinerycms-images. I've tried putting a Dragonfly compatible hash inside the refinery dragonfly initializers, and although it seems like it's picked up by the
Refinery::Dragonfly
module, it still doesn't work.This is what I'm trying to do:
Is this a bug, or am I holding it wrong?