optimize: don't try to optimize an image we can't save

This commit is contained in:
James R. Barlow
2022-01-25 00:19:23 -08:00
parent 2d0ac4707c
commit 93cca42e20

View File

@@ -203,7 +203,8 @@ def extract_image_generic(
try:
pim.as_pil_image().save(png_name(root, xref))
except NotImplementedError:
log.warning(f"PDF contains some images specifying non-CMYK inks. Ignoring it.")
log.warning("PDF contains an atypical image that cannot be optimized.")
return None
return XrefExt(xref, '.png')
elif (
not pim.indexed