Fix a bug with pdfminer which occurs when two or more filters are applied to a stream, even though no parameters are specified. The code would previously drop all of the streams after the first due to misapplication of the zip function.

pull/55/head
speedplane 2016-06-13 23:35:11 -04:00
parent 5609418351
commit b0b8818a41
1 changed files with 6 additions and 1 deletions

View File

@ -223,8 +223,13 @@ class PDFStream(PDFObject):
return []
if not isinstance(filters, list):
filters = [filters]
if not isinstance(params, list):
if not params:
# Make sure the parameters list is the same as filters.
params = [{}]*len(filters)
elif not isinstance(params, list):
params = [params]
if STRICT and len(params) != len(filters):
raise PDFException("Parameters len filter mismatch")
return zip(filters, params)
def decode(self):