class ActiveStorage::Variation

def transform(file, &block)

saves the transformed image into a temporary file.
Accepts a File object, performs the +transformations+ against it, and
def transform(file, &block)
  ActiveSupport::Notifications.instrument("transform.active_storage") do
    transformer.transform(file, format: format, &block)
  end
end