Fix OCR fails on native djvu pages

The page_width and page_height were always 600 and 800 before this patch
rendering the OCR engine confused.

This should fix #1379.
This commit is contained in:
chrox
2015-03-31 10:30:59 +08:00
parent 68e1b6ea19
commit c2924abac4
2 changed files with 3 additions and 1 deletions

View File

@@ -620,7 +620,9 @@ function KoptInterface:getNativeOCRWord(doc, pageno, rect)
kc:setZoom(30/rect.h)
local page = doc._document:openPage(pageno)
page:getPagePix(kc)
--kc:exportSrcPNGFile({rect}, nil, "ocr-word.png")
local word_w, word_h = kc:getPageDim()
--DEBUG(word_w, word_h)
local ok, word = pcall(
kc.getTOCRWord, kc, "src",
0, 0, word_w, word_h,