Module: RMagickProcessor
- Defined in:
- lib/processors/rmagick.rb
Instance Method Summary collapse
Instance Method Details
#image_to_tiff ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/processors/rmagick.rb', line 3 def image_to_tiff puts "processing with rmagick" generate_uid tmp_file = Pathname.new(Dir::tmpdir).join("#{@uid}_#{@source.basename}.tif").to_s cat = Magick::Image.read(@source.to_s).first cat.crop!(@x, @y, @w, @h) unless [@x, @y, @w, @h].compact == [] cat.write tmp_file.to_s return tmp_file end |