instance method
transform
Ruby on Rails 6.0.6
Since v5.2.8.1Signature
transform(file, format: nil, &block)
Accepts a File object, performs the transformations against it, and saves the transformed image into a temporary file. If format is specified it will be the format of the result image, otherwise the result image retains the source format.
Parameters
-
filereq -
formatkey = nil -
blockblock
Source
# File activestorage/app/models/active_storage/variation.rb, line 50
def transform(file, format: nil, &block)
ActiveSupport::Notifications.instrument("transform.active_storage") do
transformer.transform(file, format: format, &block)
end
end
Defined in activestorage/app/models/active_storage/variation.rb line 50
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Variation