Resolution: Cannot Reproduce
Affects Version/s: None
Fix Version/s: None
[imported from SourceForge]
Originally submitted by yves_bussard on 2005-09-20 22:35.
There is another Bug in FlateFilter.decode(). Let's
have a look at the following stream in the attached
174 0 obj
/LayerXML 177 0 R
/Filter [ /FlateDecode ]
/DecodeParms [ null ]
<the 94 bytes of the stream>
As described in the PDF Reference this document uses
the possibility to define an array of filters instead
of just one filter(name). In the above case the array
contains only one element (filter). In this case it
should also define an array of dictionaries (one for
each filter) which it does.
Now the decode() method is passed a parametere options
which imho should be the dictionary with the parameters
for this filter instance. Instead the options parameter
actually is the stream itself (COSStream is derived
from COSDictionary) which contains the filter
parameters in DecodeParms. Now if you have a COSArray
of COSDictionaries in the entry DecodeParms then you
have no way of knowing which set (index) of parameters
you should use. I think that the parameter options
should contain the dictionary with the parameters
itself (not the stream). This affects a few places
calling the method.
Also another bug is on line 78 in the same method:
predictor = dict.getInt("Predictor");
colors = dict.getInt("Colors");
--> bitsPerPixel =
columns = dict.getInt("Columns");
the parameter BitsPerComponent is stored at the same
location as columns. Therefore it should be from the
variable dict that the BitsPerComponent are retrieved.
To me it looks as if originally the parameter options
used to be the decode parameters and it has been
changed later on (I don't know for which reason).