AmitGorvadiya / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

minor code issue in function TesseractRect() for 3.0 #257

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Code currently uses height in its reasonable value:

  // Since this original api didn't give the exact size of the image,
  // we have to invent a reasonable value.
  int bits_per_pixel = bytes_per_pixel == 0 ? 1 : bytes_per_pixel * 8;
  SetImage(imagedata, bytes_per_line * 8 / bits_per_pixel, height,
           bytes_per_pixel, bytes_per_line);

Since the top argument is not necessarily 0, top+height might be a safer 
guess.  The last line in the rectangle is top+height-1.

I edited the last statement:
SetImage(imagedata, bytes_per_line * 8 / bits_per_pixel, height + top,
           bytes_per_pixel, bytes_per_line);

What version of the product are you using? 3.0
On what operating system?  Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by SPohor...@sjm.com on 23 Oct 2009 at 5:16

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r325.

Original comment by theraysm...@gmail.com on 17 May 2010 at 9:15

GoogleCodeExporter commented 9 years ago
Fixed.

Original comment by theraysm...@gmail.com on 17 May 2010 at 9:15