optimize: skip images with unusually small dimensions
They're unlikely to be handled well by our recompressors. It seems that JBIG2 cannot handle very small widths. Fixes #732
This commit is contained in:
@@ -76,6 +76,9 @@ def extract_image_filter(
|
||||
if image.Length < 100:
|
||||
log.debug(f"Skipping small image, xref {xref}")
|
||||
return None
|
||||
if image.Width < 8 or image.Height < 8: # Issue 732
|
||||
log.debug(f"Skipping oddly sized image, xref {xref}")
|
||||
return None
|
||||
|
||||
pim = PdfImage(image)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user