dannnylo/rtesseract

Document how to scale

Closed this issue · 1 comments

these two snippets

      image = RTesseract.read(image_path) do |img|
        img = img.scale 1.5
      end
      image = RTesseract.read(image_path) do |img|
        img = img.scale 2
      end

will have the same result. The image isn't changed and won't be touched. Absolutely no scaling here for the image outside the block.

The example is analogue to the one in the readme.
For scaling you should use the eclamation mark methods for changing the instance itself.
So it should be:

      image = RTesseract.read(image_path) do |img|
        img.scale! 2
      end

Hello.
The original file never will be changed.
You can see the final file write in the block.

image = RTesseract.read(image_path) do |img|
  img = img.scale 2
  img.write('/tmp/file.extension')
  img
end