Fixed issue 1116

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1074 d0cd1f9f-072b-0410-8dd7-cf729c803f20
This commit is contained in:
theraysmith@gmail.com 2014-04-24 00:50:27 +00:00
parent e6e6c35ee1
commit 45e106820f

View File

@ -1878,8 +1878,10 @@ bool TessBaseAPI::GetTextDirection(int* out_offset, float* out_slope) {
// Get the y-coord of the baseline at the left and right edges of the
// textline's bounding box.
int left, top, right, bottom;
if (!it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom))
if (!it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom)) {
delete it;
return false;
}
int left_y = IntCastRounded(*out_slope * left + *out_offset);
int right_y = IntCastRounded(*out_slope * right + *out_offset);
// Shift the baseline down so it passes through the nearest bottom-corner