Class: Blobsterix::Transformations::Impl::GifTransformation

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



365
366
367
# File 'lib/blobsterix/transformation/image_transformation.rb', line 365

def input_type()
  @input_type ||= Blobsterix::AcceptType.new "image/*"
end

#is_format?Boolean

Returns:

  • (Boolean)


361
362
363
# File 'lib/blobsterix/transformation/image_transformation.rb', line 361

def is_format?()
  true
end

#nameObject



357
358
359
# File 'lib/blobsterix/transformation/image_transformation.rb', line 357

def name()
  "gif"
end

#output_typeObject



369
370
371
# File 'lib/blobsterix/transformation/image_transformation.rb', line 369

def output_type()
  @output_type ||= Blobsterix::AcceptType.new "image/gif"
end

#transform(input_path, target_path, value) ⇒ Object

Raises:

  • (StandardError)


373
374
375
# File 'lib/blobsterix/transformation/image_transformation.rb', line 373

def transform(input_path, target_path, value)
  raise StandardError.new($?) unless system("convert \"#{input_path}\" gif:\"#{target_path}\"")
end