Class: Blobsterix::Transformations::Impl::MaxsizeImage
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::MaxsizeImage
- Defined in:
- lib/blobsterix/transformation/image_transformation.rb
Instance Method Summary collapse
- #input_type ⇒ Object
- #name ⇒ Object
- #output_type ⇒ Object
- #transform(input_path, target_path, value) ⇒ Object
Methods inherited from Transformation
Methods included from Logable
Instance Method Details
#input_type ⇒ Object
84 85 86 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 84 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#name ⇒ Object
81 82 83 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 81 def name() "resizemax" end |
#output_type ⇒ Object
88 89 90 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 88 def output_type() @output_type ||= Blobsterix::AcceptType.new "image/*" end |
#transform(input_path, target_path, value) ⇒ Object
92 93 94 95 96 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 92 def transform(input_path, target_path, value) image = MiniMagick::Image.open(input_path) image.resize "#{value}>" image.write target_path end |