lib/rtesseract/mixed.rb in rtesseract-1.3.3 vs lib/rtesseract/mixed.rb in rtesseract-2.0.0
- old
+ new
@@ -10,23 +10,23 @@
@value = ''
@areas = options.delete(:areas) || []
yield self if block_given?
end
- def area(x, y, width, height)
+ def area(_points)
@value = ''
- @areas << { x: x, y: y, width: width, height: height }
+ @areas << _points # { x: x, y: y, width: width, height: height }
end
def clear_areas
@areas = []
end
# Convert parts of image to string
def convert
@value = []
@areas.each_with_object(RTesseract.new(@source.to_s, @options.dup)) do |area, image|
- image.crop!(area[:x], area[:y], area[:width], area[:height])
+ image.crop!(area) # area[:x], area[:y], area[:width], area[:height])
@value << image.to_s
end
rescue => error
raise RTesseract::ConversionError.new(error), error, caller
end