Skip to content

Commit 657c51f

Browse files
committed
Document Active Storage implicit transformations
1 parent 21f9db1 commit 657c51f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

guides/source/active_storage_overview.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,12 @@ location.
850850
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100]) %>
851851
```
852852

853+
If a variant is requested, Active Storage will automatically apply
854+
transformations depending on the image's format:
855+
856+
1. Content types that are `variable` and not considered [`web images`], will be converted to PNG.
857+
2. If `quality` is not specified, the variant processor's default quality for the format will be used.
858+
853859
The default processor for Active Storage is MiniMagick, but you can also use
854860
[Vips][]. To switch to Vips, add the following to `config/application.rb`:
855861

@@ -870,6 +876,8 @@ specific:
870876
```
871877

872878
[`variant`]: https://api.rubyonrails.org/classes/ActiveStorage/Blob/Representable.html#method-i-variant
879+
[`web images`]: https://github.com/rails/rails/blob/main/activestorage/lib/active_storage/engine.rb#L47
880+
[`variable`]: https://github.com/rails/rails/blob/main/activestorage/lib/active_storage/engine.rb#L34
873881
[Vips]: https://www.rubydoc.info/gems/ruby-vips/Vips/Image
874882

875883
### Previewing Files

0 commit comments

Comments
 (0)