Sha256: a787498c22d9e568e35766f94b5c944be7d92f37b083609378488547d9ffd1f4
Contents?: true
Size: 592 Bytes
Versions: 5
Compression:
Stored size: 592 Bytes
Contents
module Spontaneous::Media::Image class Processor include Spontaneous::Media::Image::Skeptick def initialize(input, output) @input, @output = input, output end def apply(process) if imagemagick_installed? cmd = convert(@input, :to => @output, &process) cmd.run else logger.warn("Unable to re-size image, Imagemagick is not installed.") FileUtils::Verbose.cp(@input, @output) end end def optimize! end def imagemagick_installed? Kernel.system('which convert >/dev/null 2>&1') end end end
Version data entries
5 entries across 5 versions & 1 rubygems