Class: Blobsterix::Transformations::Impl::AsciiTransformation

Inherits:
Transformation
  • Object
show all
Defined in:
lib/blobsterix/transformation/image_transformation.rb

Instance Method Summary collapse

Methods inherited from Transformation

#to_s

Methods included from Logable

#logger, #logger=

Instance Method Details

#input_typeObject



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

Returns:

  • (Boolean)


268
269
270
# File 'lib/blobsterix/transformation/image_transformation.rb', line 268

def is_format?()
  true
end

#nameObject



264
265
266
# File 'lib/blobsterix/transformation/image_transformation.rb', line 264

def name()
  "ascii"
end

#output_typeObject



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

Raises:

  • (StandardError)


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