Class: Blobsterix::Transformations::Impl::ColorSpaceImage
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::ColorSpaceImage
- 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
6 7 8 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 6 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#name ⇒ Object
3 4 5 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 3 def name() "grayscale" end |
#output_type ⇒ Object
10 11 12 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 10 def output_type() @output_type ||= Blobsterix::AcceptType.new "image/*" end |
#transform(input_path, target_path, value) ⇒ Object
14 15 16 17 18 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 14 def transform(input_path, target_path, value) image = MiniMagick::Image.open(input_path) image.colorspace "gray" image.write target_path end |