Remove leptonica and cffi

This commit is contained in:
James R. Barlow
2021-11-13 00:06:35 -08:00
parent 036afc4d88
commit 5abfb14c2a
18 changed files with 13 additions and 1675 deletions
+2 -3
View File
@@ -12,7 +12,6 @@ from PIL import Image
from ocrmypdf._exec import ghostscript, tesseract
from ocrmypdf.helpers import Resolution
from ocrmypdf.leptonica import Pix
from ocrmypdf.pdfinfo import PdfInfo
from .conftest import check_ocrmypdf, have_unpaper
@@ -24,8 +23,7 @@ def test_deskew(resources, outdir):
# Run with deskew
deskewed_pdf = check_ocrmypdf(resources / 'skew.pdf', outdir / 'skew.pdf', '-d')
# Now render as an image again and use Leptonica to find the skew angle
# to confirm that it was deskewed
# Now render as an image again...
deskewed_png = outdir / 'deskewed.png'
ghostscript.rasterize_pdf(
@@ -36,6 +34,7 @@ def test_deskew(resources, outdir):
pageno=1,
)
# ...and use Tessera to find the skew angle to confirm that it was deskewed
skew_angle = tesseract.get_deskew(deskewed_png, [], None, 5.0)
print(skew_angle)
assert -0.5 < skew_angle < 0.5, "Deskewing failed"