Compare commits

..
4 Commits
4 changed files with 13 additions and 11 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Installing a JBIG2 encoder
Installing the JBIG2 encoder
==========================
Most Linux distributions do not include a JBIG2 encoder since JBIG2 encoding was patented for a long time. All known JBIG2 US patents have expired as of 2017, but it is possible that unknown patents exist.
+5
View File
@@ -13,6 +13,11 @@ Note that it is licensed under GPLv3, so scripts that ``import ocrmypdf`` and ar
find: [^`]\#([0-9]{1,3})[^0-9]
replace: `#$1 <https://github.com/jbarlow83/OCRmyPDF/issues/$1>`_
v7.0.3
------
- Fix issue `#284 <https://github.com/jbarlow83/OCRmyPDF/issues/284>`_, an error when parsing inline images that have are also image masks, by upgrading pikepdf to 0.3.1
v7.0.2
------
+1 -1
View File
@@ -249,7 +249,7 @@ setup(
install_requires=[
'cffi >= 1.9.1', # must be a setup and install requirement
'img2pdf >= 0.2.4, < 0.4', # pure Python, so track HEAD closely
'pikepdf >= 0.2.2, < 0.4',
'pikepdf >= 0.3.1, < 0.4',
'Pillow >= 4.0.0, != 5.1.0 ; sys_platform == "darwin"',
# Pillow < 4 has BytesIO/TIFF bug w/img2pdf 0.2.3
# block 5.1.0, broken wheels
+6 -9
View File
@@ -24,11 +24,6 @@ import sys
from PIL import Image
import pikepdf
try:
from pikepdf import Null # pikepdf <= 0.2.2
except ImportError:
def Null(): # pikepdf > 0.2.2
return None
from ._jobcontext import JobContext
from . import leptonica
@@ -245,8 +240,7 @@ def transcode_jpegs(pike, jpegs, root, log, options):
compdata = leptonica.CompressedData.open(opt_jpg)
im_obj = pike.get_object(xref, 0)
im_obj.write(
compdata.read(), pikepdf.Name('/DCTDecode'),
Null()
compdata.read(), filter=pikepdf.Name('/DCTDecode')
)
@@ -286,7 +280,7 @@ def transcode_pngs(pike, pngs, root, log, options):
if len(compdata) > int(im_obj.stream_dict.Length):
continue # If we produced a larger image, don't use
predictor = Null()
predictor = None
if compdata.predictor > 0:
predictor = pikepdf.Dictionary({'/Predictor': compdata.predictor})
@@ -309,7 +303,10 @@ def transcode_pngs(pike, pngs, root, log, options):
elif compdata.spp == 4:
cs = pikepdf.Name('/DeviceCMYK')
im_obj.ColorSpace = cs
im_obj.write(compdata.read(), pikepdf.Name('/FlateDecode'), predictor)
im_obj.write(
compdata.read(),
filter=pikepdf.Name('/FlateDecode'), decode_parms=predictor
)
def optimize(