Stop special-casing the dict parameter in the Jbig2Stream/JpegStream/JpxStream constructors

For all of the other `DecodeStream`s we're not passing in a `Dict`-instance manually, but instead get it from the `stream`-parameter. Hence there's no particularly good reason, as far as I can tell, to not do the same thing in `Jbig2Stream`/`JpegStream`/`JpxStream` as well.
This commit is contained in:
Jonas Jenwald 2021-04-27 22:35:53 +02:00
parent 67a1cfc1b1
commit fb0775525e
4 changed files with 9 additions and 9 deletions

View file

@ -765,11 +765,11 @@ class Parser {
}
if (name === "DCTDecode" || name === "DCT") {
xrefStreamStats[StreamType.DCT] = true;
return new JpegStream(stream, maybeLength, stream.dict, params);
return new JpegStream(stream, maybeLength, params);
}
if (name === "JPXDecode" || name === "JPX") {
xrefStreamStats[StreamType.JPX] = true;
return new JpxStream(stream, maybeLength, stream.dict, params);
return new JpxStream(stream, maybeLength, params);
}
if (name === "ASCII85Decode" || name === "A85") {
xrefStreamStats[StreamType.A85] = true;
@ -789,7 +789,7 @@ class Parser {
}
if (name === "JBIG2Decode") {
xrefStreamStats[StreamType.JBIG] = true;
return new Jbig2Stream(stream, maybeLength, stream.dict, params);
return new Jbig2Stream(stream, maybeLength, params);
}
warn(`Filter "${name}" is not supported.`);
return stream;