class

ActiveStorage::Variation

Inherits Reference < Object

Constructors

new(transformations : Hash(String, Value))
Source

Instance methods

content_type

The gem: Marcel::MimeType.for(extension: format).

Source
format

transformations.fetch(:format, :png), validated through Marcel (the gem: Marcel::Magic.by_extension(format).nil? → ArgumentError).

Source
key

64-hex key identifying these transformations.

Source
transform(input : String | Bytes, source_format : String = "png") : Bytes

Runs the transformations against raw image bytes and returns the encoded result in #format. The gem hands a File to the transformer (transformer.transform(file, format:)); the port stages the bytes in a temp file and reads the transformed output back.

Source
transformations
Source

Nested types