While developing a new Rails Application, I noticed the following deprecation warning in the console:
DEPRECATION WARNING: Active Storage's ImageProcessing transformer doesn't support :combine_options, as it always generates a single ImageMagick command. Passing :combine_options will not be supported in Rails 6.1.
This is also mentioned in the Rails 6 release notes:
Deprecate :combine_options in Active Storage's ImageProcessing transformer without replacement.
Now I'm wondering:
<%= image_tag @category.image.variant(combine_options: {
resize_to_fill: [800,50] }, gaussian_blur: ['0x1.5']), class:
"card-img-top" if @category.image.attached? %>
I should have looked better in the API Documentation.
ActiveStore.Variant
takes multiple arguments directly. Taking my example above, the following works and will continue to work:
<%= image_tag @category.image.variant(resize_to_fill: [800,50], gaussian_blur: ['0x1.5']), class: "card-img-top" if @category.image.attached? %>
As a result there's no need to use combine_options
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With