Active Storage Transformers Transformer
A Transformer
applies a set of transformations to an image.
The following concrete subclasses are included in Active Storage:
-
ActiveStorage::Transformers::ImageProcessingTransformer
: backed by ImageProcessing, a common interface for MiniMagick and ruby-vips
Methods
Attributes
[R] | transformations |
Class Public methods
new(transformations) Link
Instance Public methods
transform(file, format:) Link
Applies the transformations to the source image in file
, producing a target image in the specified format
. Yields an open Tempfile containing the target image. Closes and unlinks the output tempfile after yielding to the given block. Returns the result of the block.
Instance Private methods
process(file, format:) Link
Returns an open Tempfile containing a transformed image in the given format
. All subclasses implement this method.