From 5b7c8cf5d3d46cbba8e214803dbef0fee18560fd Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 14 Apr 2016 14:24:33 -0700 Subject: [PATCH] Remove check for /ImageMask /ImageMask means the the image is a stencil mask for a grayscale or color image. From issue #63 a user has a PDF apparently with only a stencil mask and no other images. According to PDF spec you're supposed to use masks to help draw other images rather than draw masks explicitly, although drawing masks is not forbidden. In the event that the image mask is higher resolution than the input image, the composite image should be drawn at the highest DPI to a ccurately capture the effect of the mask. It looks like the right to do is take masks into account rather than ignore them (a holdover from earlier, less robust versions), or don't treat it different. --- ocrmypdf/pageinfo.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ocrmypdf/pageinfo.py b/ocrmypdf/pageinfo.py index 42cd3b5e..301866da 100644 --- a/ocrmypdf/pageinfo.py +++ b/ocrmypdf/pageinfo.py @@ -201,9 +201,6 @@ def _find_page_images(page, pageinfo, contentsinfo): pdfimage = page['/Resources']['/XObject'][xobj] if pdfimage['/Subtype'] != '/Image': continue - if '/ImageMask' in pdfimage: - if pdfimage['/ImageMask']: - continue image = {} image['name'] = str(xobj) image['width'] = pdfimage['/Width']