File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -850,6 +850,12 @@ location.
850
850
<%= image_tag user.avatar.variant(resize_to_limit: [100, 100]) % >
851
851
` ` `
852
852
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
+
853
859
The default processor for Active Storage is MiniMagick, but you can also use
854
860
[Vips][]. To switch to Vips, add the following to `config/application.rb` :
855
861
@@ -870,6 +876,8 @@ specific:
870
876
` ` `
871
877
872
878
[`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
873
881
[Vips] : https://www.rubydoc.info/gems/ruby-vips/Vips/Image
874
882
875
883
# ## Previewing Files
You can’t perform that action at this time.
0 commit comments