Class: Blobsterix::Transformations::Impl::PngTransformation

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



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

Returns:

  • (Boolean)


317
318
319
# File 'lib/blobsterix/transformation/image_transformation.rb', line 317

def is_format?()
  true
end

#nameObject



313
314
315
# File 'lib/blobsterix/transformation/image_transformation.rb', line 313

def name()
  "png"
end

#output_typeObject



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

Raises:

  • (StandardError)


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