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
Copy file name to clipboardExpand all lines: guides/source/active_storage_overview.md
+49-19Lines changed: 49 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -533,68 +533,98 @@ It's important to know that the file is not yet available in the `after_create`
533
533
Analyzing Files
534
534
---------------
535
535
536
-
Active Storage [analyzes](https://api.rubyonrails.org/classes/ActiveStorage/Blob/Analyzable.html#method-i-analyze) files once they've been uploaded by queuing a job in Active Job. Analyzed files will store additional information in the metadata hash, including `analyzed: true`. You can check whether a blob has been analyzed by calling [`analyzed?`][] on it.
536
+
Active Storage analyzes files once they've been uploaded by queuing a job in Active Job. Analyzed files will store additional information in the metadata hash, including `analyzed: true`. You can check whether a blob has been analyzed by calling [`analyzed?`][] on it.
537
537
538
538
Image analysis provides `width` and `height` attributes. Video analysis provides these, as well as `duration`, `angle`, and `display_aspect_ratio`.
539
539
540
540
Analysis requires the `mini_magick` gem. Video analysis also requires the [FFmpeg](https://www.ffmpeg.org/) library, which you must include separately.
Transforming images allows you to display the image at your choice of dimensions.
547
580
To enable variants, add the `image_processing` gem to your `Gemfile`:
548
581
549
582
```ruby
550
583
gem 'image_processing'
551
584
```
552
585
553
-
To create a variation of an image, call [`variant`][] on the attachment. You can pass any transformation to the method supported by the processor. The default processor for Active Storage is MiniMagick, but you can also use [Vips](https://www.rubydoc.info/gems/ruby-vips/Vips/Image).
554
-
555
-
When the browser hits the variant URL, Active Storage will lazily transform the
556
-
original blob into the specified format and redirect to its new service
586
+
To create a variation of an image, call [`variant`][] on the attachment. You
587
+
can pass any transformation supported by the variant processor to the method.
588
+
When the browser hits the variant URL, Active Storage will lazily transform
589
+
the original blob into the specified format and redirect to its new service
0 commit comments