Class: Blobsterix::Transformations::Impl::AsciiTransformation
- Inherits:
-
Transformation
- Object
- Transformation
- Blobsterix::Transformations::Impl::AsciiTransformation
- 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
272 273 274 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 272 def input_type() @input_type ||= Blobsterix::AcceptType.new "image/*" end |
#is_format? ⇒ Boolean
268 269 270 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 268 def is_format?() true end |
#name ⇒ Object
264 265 266 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 264 def name() "ascii" end |
#output_type ⇒ Object
276 277 278 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 276 def output_type() @output_type ||= Blobsterix::AcceptType.new "text/plain" end |
#transform(input_path, target_path, value) ⇒ Object
280 281 282 |
# File 'lib/blobsterix/transformation/image_transformation.rb', line 280 def transform(input_path, target_path, value) raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:- | jp2a --width=#{value and value.size > 0 ? value : 100} - > \"#{target_path}\"") end |