Class: Blobsterix::Transformations::Impl::ResizeImage
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::ResizeImage
- 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
65 66 67 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 65 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#name ⇒ Object
62 63 64 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 62 def name() "resize" end |
#output_type ⇒ Object
69 70 71 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 69 def output_type() @output_type ||= Blobsterix::AcceptType.new "image/*" end |
#transform(input_path, target_path, value) ⇒ Object
73 74 75 76 77 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 73 def transform(input_path, target_path, value) image = MiniMagick::Image.open(input_path) image.resize value image.write target_path end |