Skip to content

Commit

Permalink
don't down-scale image in leptonica, do it when getting source image
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox committed Jun 14, 2016
1 parent cd57b68 commit 6fa062f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ffi/koptcontext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,8 @@ function KOPTContext_mt.__index:findPageBlocks()
if self.src.data then
local pixs = k2pdfopt.bitmap2pix(self.src,
0, 0, self.src.width, self.src.height)
local pixb = leptonica.pixThresholdToBinary(pixs, 128)
local pixr = leptonica.pixReduceRankBinaryCascade(pixb, 1, 0, 0, 0)
local pixr = leptonica.pixThresholdToBinary(pixs, 128)
leptonica.pixDestroy(ffi.new('PIX *[1]', pixs))
leptonica.pixDestroy(ffi.new('PIX *[1]', pixb))

local pixtb = ffi.new("PIX *[1]")
local status = leptonica.pixGetRegionsBinary(pixr, nil, nil, pixtb, 0)
Expand Down

0 comments on commit 6fa062f

Please sign in to comment.