class
ActiveStorage::VariantProcessor::VipsProcessor
Overview
Runs the transformations of a variation with libvips.
This is the processor Rails defaults to from load_defaults 7.0 on
(config.active_storage.variant_processor = :vips), and every operation below mirrors
image_processing's vips backend, so a variant produced here carries the dimensions Rails' own
pass would have produced. Byte equality is not a goal: it moves with the libvips version.
The source is loaded once and each operation is applied in the order the variation wrote it, which
is why #process walks the hash instead of looking up known keys: rotate before a resize and
rotate after it are different images.
https://github.com/janko/image_processing/blob/master/lib/image_processing/vips.rb
Direct Known Subclasses
- ActiveStorage::VariantProcessor::VipsProcessorAccessTest::AccessReader
- ActiveStorage::VariantProcessor::VipsProcessorAccessTest::RandomAccessProcessor
Defined in:
active_storage/variant_processor/vips_processor.crConstant Summary
-
MAX_COORD =
10000000 -
Stands for a dimension that is not constrained.
The resize operations take a box, and a
nilside means "leave this one free". libvips has no such value, soimage_processingpassesVips::MAX_COORDinstead, which is this number.
Instance Method Summary
-
#process(source : Bytes, transformations : JSON::Any, format : String) : Bytes
Returns
sourcewithtransformationsapplied, encoded asformat.
Instance methods inherited from class ActiveStorage::VariantProcessor
process(source : Bytes, transformations : JSON::Any, format : String) : Bytes
process
Instance Method Detail
Returns source with transformations applied, encoded as format.
transformations carries no format key, matching the transformations.except(:format) that
Rails hands its transformer.
Raises NotImplementedError unless a backend is assigned, as the Rails base service does for
the methods a service has to implement.