From 3565578196c001d5a3099d3fa9a754e4c2832403 Mon Sep 17 00:00:00 2001 From: chrox Date: Thu, 29 May 2014 19:13:54 +0800 Subject: [PATCH] fix auto bbox calculation in in top-to-bottom writing direction --- ffi/koptcontext.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ffi/koptcontext.lua b/ffi/koptcontext.lua index cc9c69605..00c02faed 100644 --- a/ffi/koptcontext.lua +++ b/ffi/koptcontext.lua @@ -216,6 +216,8 @@ function KOPTContext_mt.__index:getTOCRWord(bmp, x, y, w, h, datadir, lang, ocr_ end function KOPTContext_mt.__index:getAutoBBox() + -- fall back to default writing direction when detecting bbox + self:setWritingDirection(0) k2pdfopt.k2pdfopt_crop_bmp(self) local x0 = self.bbox.x0/self.zoom local y0 = self.bbox.y0/self.zoom