optimize: work around pikepdf 1.6.3 limitation with indexed ICCbased colorspaces

This commit is contained in:
James R. Barlow
2019-09-11 12:56:27 -07:00
parent 078bc2abe9
commit cf4b04c5d1
+5
View File
@@ -111,6 +111,11 @@ def extract_image_generic(*, pike, root, log, image, xref, options):
if pim.bits_per_component == 1:
return None
try:
pim.indexed # pikepdf 1.6.3 can't handle [/Indexed [/Array...]]
except NotImplementedError:
return None
if filtdp[0] == Name.DCTDecode and options.optimize >= 2:
# This is a simple heuristic derived from some training data, that has
# about a 70% chance of guessing whether the JPEG is high quality,