Class: Riiif::ImagemagickCommandFactory
- Inherits:
-
Object
- Object
- Riiif::ImagemagickCommandFactory
- Defined in:
- app/services/riiif/imagemagick_command_factory.rb
Overview
Builds a command to run a transformation using Imagemagick
Instance Attribute Summary collapse
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#sampling_factor ⇒ Object
readonly
Returns the value of attribute sampling_factor.
-
#strip_metadata ⇒ Object
readonly
Returns the value of attribute strip_metadata.
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Instance Method Summary collapse
-
#command ⇒ String
A command for running imagemagick to produce the requested output.
-
#initialize(path, info, transformation, compression: 85, sampling_factor: '4:2:0', strip_metadata: true) ⇒ ImagemagickCommandFactory
constructor
A helper method to instantiate and invoke build.
- #reduction_factor ⇒ Object
Constructor Details
#initialize(path, info, transformation, compression: 85, sampling_factor: '4:2:0', strip_metadata: true) ⇒ ImagemagickCommandFactory
A helper method to instantiate and invoke build
17 18 19 20 21 22 23 24 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 17 def initialize(path, info, transformation, compression: 85, sampling_factor: '4:2:0', strip_metadata: true) @path = path @info = info @transformation = transformation @compression = compression @sampling_factor = sampling_factor @strip_metadata = end |
Instance Attribute Details
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def compression @compression end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def info @info end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def path @path end |
#sampling_factor ⇒ Object (readonly)
Returns the value of attribute sampling_factor.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def sampling_factor @sampling_factor end |
#strip_metadata ⇒ Object (readonly)
Returns the value of attribute strip_metadata.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def @strip_metadata end |
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
26 27 28 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 26 def transformation @transformation end |
Instance Method Details
#command ⇒ String
Returns a command for running imagemagick to produce the requested output.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 29 def command [ external_command, crop, size, rotation, colorspace, quality, sampling, , alpha_channel, input, output ].join end |
#reduction_factor ⇒ Object
45 46 47 |
# File 'app/services/riiif/imagemagick_command_factory.rb', line 45 def reduction_factor nil end |