From c2924abac4c90f3daa914e4b574d4f264493feb7 Mon Sep 17 00:00:00 2001 From: chrox Date: Tue, 31 Mar 2015 10:30:59 +0800 Subject: [PATCH] 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. --- base | 2 +- frontend/document/koptinterface.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base b/base index 57d4cca62..5af9c0e97 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 57d4cca62d6e1f14c32bf883a4d3b3ff63b2a9cd +Subproject commit 5af9c0e97716d94df47ad07a3639263a6ed49e3d diff --git a/frontend/document/koptinterface.lua b/frontend/document/koptinterface.lua index 64897f899..c6f1ba0b7 100644 --- a/frontend/document/koptinterface.lua +++ b/frontend/document/koptinterface.lua @@ -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,