Class: Blobsterix::Transformations::Impl::CropImage
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::CropImage
- 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
146 147 148 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 146 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#name ⇒ Object
143 144 145 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 143 def name() "crop" end |
#output_type ⇒ Object
150 151 152 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 150 def output_type() @output_type ||= Blobsterix::AcceptType.new "image/*" end |
#transform(input_path, target_path, value) ⇒ Object
154 155 156 157 158 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 154 def transform(input_path, target_path, value) image = MiniMagick::Image.open(input_path) image.crop value image.write target_path end |