Class: Blobsterix::Transformations::Impl::AdaptiveResizeImage

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

Instance Method Summary collapse

Methods inherited from Transformation

#is_format?, #to_s

Methods included from Logable

#logger, #logger=

Instance Method Details

#input_typeObject



46
47
48
# File 'lib/blobsterix/transformation/image_transformation.rb', line 46

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

#nameObject



43
44
45
# File 'lib/blobsterix/transformation/image_transformation.rb', line 43

def name()
  "aresize"
end

#output_typeObject



50
51
52
# File 'lib/blobsterix/transformation/image_transformation.rb', line 50

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

#transform(input_path, target_path, value) ⇒ Object



54
55
56
57
58
# File 'lib/blobsterix/transformation/image_transformation.rb', line 54

def transform(input_path, target_path, value)
  image = MiniMagick::Image.open(input_path)
  image.adaptive_resize value
  image.write target_path
end