Class: Blobsterix::Transformations::Impl::StripImage

Inherits:
Transformation 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



122
123
124
# File 'lib/blobsterix/transformation/image_transformation.rb', line 122

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

#is_format?Boolean

Returns:

  • (Boolean)


130
131
132
# File 'lib/blobsterix/transformation/image_transformation.rb', line 130

def is_format?()
  true
end

#nameObject



119
120
121
# File 'lib/blobsterix/transformation/image_transformation.rb', line 119

def name()
  "strip"
end

#output_typeObject



126
127
128
# File 'lib/blobsterix/transformation/image_transformation.rb', line 126

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

#transform(input_path, target_path, value) ⇒ Object



134
135
136
137
138
139
# File 'lib/blobsterix/transformation/image_transformation.rb', line 134

def transform(input_path, target_path, value)
  image = MiniMagick::Image.open(input_path)
  image.strip
  image.write target_path
  # system("convert #{input_path} -strip #{target_path}")
end