Skip to content

Commit e581678

Browse files
authored
Merge pull request rails#42482 from FestaLab/activestorage-documentation
Explain differences between active storage variant processors [skip ci]
2 parents 1e1ca11 + 22e5f95 commit e581678

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

guides/source/active_storage_overview.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,18 @@ The default processor for Active Storage is MiniMagick, but you can also use
713713
config.active_storage.variant_processor = :vips
714714
```
715715

716+
The two processors are not fully compatible, so when migrating an existing application
717+
using MiniMagick to Vips, some changes have to be made if using options that are format
718+
specific:
719+
720+
```rhtml
721+
<!-- MiniMagick -->
722+
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100], format: :jpeg, sampling_factor: "4:2:0", strip: true, interlace: "JPEG", colorspace: "sRGB", quality: 80) %>
723+
724+
<!-- Vips -->
725+
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100], format: :jpeg, saver: { subsample_mode: "on", strip: true, interlace: true, quality: 80 }) %>
726+
```
727+
716728
[`variant`]: https://api.rubyonrails.org/classes/ActiveStorage/Blob/Representable.html#method-i-variant
717729
[Vips]: https://www.rubydoc.info/gems/ruby-vips/Vips/Image
718730

0 commit comments

Comments
 (0)