Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e23ea5364 | ||
|
|
cf9a8a91b5 | ||
|
|
05d3a65e94 | ||
|
|
755f6e0979 |
+1
-1
@@ -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.
|
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.
|
||||||
|
|||||||
@@ -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]
|
find: [^`]\#([0-9]{1,3})[^0-9]
|
||||||
replace: `#$1 <https://github.com/jbarlow83/OCRmyPDF/issues/$1>`_
|
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
|
v7.0.2
|
||||||
------
|
------
|
||||||
|
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ setup(
|
|||||||
install_requires=[
|
install_requires=[
|
||||||
'cffi >= 1.9.1', # must be a setup and install requirement
|
'cffi >= 1.9.1', # must be a setup and install requirement
|
||||||
'img2pdf >= 0.2.4, < 0.4', # pure Python, so track HEAD closely
|
'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.0.0, != 5.1.0 ; sys_platform == "darwin"',
|
||||||
# Pillow < 4 has BytesIO/TIFF bug w/img2pdf 0.2.3
|
# Pillow < 4 has BytesIO/TIFF bug w/img2pdf 0.2.3
|
||||||
# block 5.1.0, broken wheels
|
# block 5.1.0, broken wheels
|
||||||
|
|||||||
@@ -24,11 +24,6 @@ import sys
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
import pikepdf
|
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 ._jobcontext import JobContext
|
||||||
from . import leptonica
|
from . import leptonica
|
||||||
@@ -245,8 +240,7 @@ def transcode_jpegs(pike, jpegs, root, log, options):
|
|||||||
compdata = leptonica.CompressedData.open(opt_jpg)
|
compdata = leptonica.CompressedData.open(opt_jpg)
|
||||||
im_obj = pike.get_object(xref, 0)
|
im_obj = pike.get_object(xref, 0)
|
||||||
im_obj.write(
|
im_obj.write(
|
||||||
compdata.read(), pikepdf.Name('/DCTDecode'),
|
compdata.read(), filter=pikepdf.Name('/DCTDecode')
|
||||||
Null()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -286,7 +280,7 @@ def transcode_pngs(pike, pngs, root, log, options):
|
|||||||
if len(compdata) > int(im_obj.stream_dict.Length):
|
if len(compdata) > int(im_obj.stream_dict.Length):
|
||||||
continue # If we produced a larger image, don't use
|
continue # If we produced a larger image, don't use
|
||||||
|
|
||||||
predictor = Null()
|
predictor = None
|
||||||
if compdata.predictor > 0:
|
if compdata.predictor > 0:
|
||||||
predictor = pikepdf.Dictionary({'/Predictor': compdata.predictor})
|
predictor = pikepdf.Dictionary({'/Predictor': compdata.predictor})
|
||||||
|
|
||||||
@@ -309,7 +303,10 @@ def transcode_pngs(pike, pngs, root, log, options):
|
|||||||
elif compdata.spp == 4:
|
elif compdata.spp == 4:
|
||||||
cs = pikepdf.Name('/DeviceCMYK')
|
cs = pikepdf.Name('/DeviceCMYK')
|
||||||
im_obj.ColorSpace = cs
|
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(
|
def optimize(
|
||||||
|
|||||||
Reference in New Issue
Block a user