Sha256: b6d5f159d9d6a9c37fc565141ed0d8b0d24e1af9139a12b24369881fc652e272

Contents?: true

Size: 842 Bytes

Versions: 10

Compression:

Stored size: 842 Bytes

Contents

module Riiif
  # Transforms an image using a backend
  class AbstractTransformer
    # @param path [String] The path of the source image file
    # @param image_info [ImageInformation] information about the source
    # @param [Transformation] transformation
    def self.transform(path, image_info, transformation)
      new(path, image_info, transformation).transform
    end

    def initialize(path, image_info, transformation)
      @path = path
      @image_info = image_info
      @transformation = transformation
    end

    attr_reader :path, :image_info, :transformation

    def transform
      execute(command_builder.command)
    end

    def command_builder
      @command_builder ||= command_factory.new(path, image_info, transformation)
    end

    delegate :execute, to: Riiif::CommandRunner
    private :execute
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
riiif-2.6.0 app/transformers/riiif/abstract_transformer.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/riiif-2.5.0/app/transformers/riiif/abstract_transformer.rb
riiif-2.5.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.4.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.3.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.2.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.1.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.0.0 app/transformers/riiif/abstract_transformer.rb
riiif-2.0.0.beta2 app/transformers/riiif/abstract_transformer.rb
riiif-2.0.0.beta1 app/transformers/riiif/abstract_transformer.rb