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.
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user