lib/processors/rmagick.rb in rtesseract-1.0.1 vs lib/processors/rmagick.rb in rtesseract-1.0.2
- old
+ new
@@ -1,12 +1,13 @@
+# encoding: UTF-8
require "RMagick"
module RMagickProcessor
extend self
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
+ cat.write(tmp_file.path.to_s){self.compression = Magick::NoCompression}
return tmp_file
end
def read_with_processor(path)
Magick::Image.read(path.to_s).first