Module: RMagickProcessor
Instance Method Summary collapse
Instance Method Details
#image_to_tiff ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/processors/rmagick.rb', line 5 def image_to_tiff tmp_file = Tempfile.new(["",".tif"]) cat = @instance || Magick::Image.read(@source.to_s).first cat.crop!(@x, @y, @w, @h) unless [@x, @y, @w, @h].compact == [] cat.write(tmp_file.path.to_s){self.compression = Magick::NoCompression} return tmp_file end |
#is_a_instance?(object) ⇒ Boolean
17 18 19 |
# File 'lib/processors/rmagick.rb', line 17 def is_a_instance?(object) object.class == Magick::Image end |
#read_with_processor(path) ⇒ Object
13 14 15 |
# File 'lib/processors/rmagick.rb', line 13 def read_with_processor(path) Magick::Image.read(path.to_s).first end |