Skip to content

Commit

Permalink
optimize: log images with unclear decode tables
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed Feb 1, 2024
1 parent 2005f62 commit 07b6f06
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ocrmypdf/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ def extract_image_jbig2(
with imgname.open('wb') as f:
ext = pim.extract_to(stream=f)
imgname.rename(imgname.with_suffix(ext))
except NotImplementedError as e:
if '/Decode' in str(e):
log.debug(
f"xref {xref}: skipping image with unsupported Decode table"
)
return None
raise
except UnsupportedImageTypeError:
return None
finally:
Expand Down

0 comments on commit 07b6f06

Please sign in to comment.