Class: Presto::MiniMagick::Processor
- Inherits:
-
Object
- Object
- Presto::MiniMagick::Processor
- Defined in:
- lib/presto/mini_magick.rb
Instance Attribute Summary collapse
-
#transformation ⇒ Object
readonly
Returns the value of attribute transformation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Processor
constructor
A new instance of Processor.
- #process(image) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Processor
Returns a new instance of Processor.
15 16 17 |
# File 'lib/presto/mini_magick.rb', line 15 def initialize params={} @transformation = ::Presto::Transformation.new(params) end |
Instance Attribute Details
#transformation ⇒ Object (readonly)
Returns the value of attribute transformation.
13 14 15 |
# File 'lib/presto/mini_magick.rb', line 13 def transformation @transformation end |
Class Method Details
.process(image, params = {}) ⇒ Object
9 10 11 |
# File 'lib/presto/mini_magick.rb', line 9 def self.process image, params={} new(params).process(image) end |
Instance Method Details
#process(image) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/presto/mini_magick.rb', line 19 def process image return image if trans.empty? trans.validate! process_fit(image) if trans[:w] || trans[:h] process_format(image) if trans[:fm] process_quality(image) if trans[:q] image rescue ::Veto::InvalidEntity => e raise(::Presto::InvalidTransformation, e.) end |