You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 except image/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.
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.rbas 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.
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?
The text was updated successfully, but these errors were encountered: