Class: Blobsterix::Transformations::Impl::PngTransformation
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::PngTransformation
- Defined in:
- lib/blobsterix/transformation/image_transformation.rb
Instance Method Summary collapse
- #input_type ⇒ Object
- #is_format? ⇒ Boolean
- #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
321 322 323 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 321 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#is_format? ⇒ Boolean
317 318 319 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 317 def is_format?() true end |
#name ⇒ Object
313 314 315 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 313 def name() "png" end |
#output_type ⇒ Object
325 326 327 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 325 def output_type() @output_type ||= Blobsterix::AcceptType.new "image/png" end |
#transform(input_path, target_path, value) ⇒ Object
329 330 331 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 329 def transform(input_path, target_path, value) raise StandardError.new($?) unless system("convert \"#{input_path}\" png:\"#{target_path}\"") end |