Class: ImageSqueeze::GIFToPNGProcessor
- Defined in:
- lib/image_squeeze/processors/gif_to_png_processor.rb
Instance Attribute Summary
Attributes inherited from Processor
Class Method Summary collapse
Methods inherited from Processor
Class Method Details
.input_type ⇒ Object
3 4 5 |
# File 'lib/image_squeeze/processors/gif_to_png_processor.rb', line 3 def self.input_type GIF end |
.output_extension ⇒ Object
7 8 9 |
# File 'lib/image_squeeze/processors/gif_to_png_processor.rb', line 7 def self.output_extension '.png' end |
.squeeze(filename, output_filename) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/image_squeeze/processors/gif_to_png_processor.rb', line 11 def self.squeeze(filename, output_filename) intermediate_tmp_filename = "%s-%s" % [output_filename, '.tmp'] system("convert #{filename} PNG:#{intermediate_tmp_filename} 2> /dev/null") response = PNGCrushProcessor.squeeze(intermediate_tmp_filename, output_filename) # run it through PNGCrush afterwards FileUtils.rm(intermediate_tmp_filename) # clean up after ourselves response end |