Merge pull request #13337 from Snuffleupagus/PredictorStream-super
[Regression] Move the `super`-call in the `PredictorStream`-constructor to prevent errors (PR 13303)
This commit is contained in:
commit
52961197d3
@ -19,10 +19,12 @@ import { isDict } from "./primitives.js";
|
||||
|
||||
class PredictorStream extends DecodeStream {
|
||||
constructor(str, maybeLength, params) {
|
||||
super(maybeLength);
|
||||
|
||||
if (!isDict(params)) {
|
||||
return str; // no prediction
|
||||
}
|
||||
const predictor = params.get("Predictor") || 1;
|
||||
const predictor = (this.predictor = params.get("Predictor") || 1);
|
||||
|
||||
if (predictor <= 1) {
|
||||
return str; // no prediction
|
||||
@ -30,8 +32,6 @@ class PredictorStream extends DecodeStream {
|
||||
if (predictor !== 2 && (predictor < 10 || predictor > 15)) {
|
||||
throw new FormatError(`Unsupported predictor: ${predictor}`);
|
||||
}
|
||||
super(maybeLength);
|
||||
this.predictor = predictor;
|
||||
|
||||
if (predictor === 2) {
|
||||
this.readBlock = this.readBlockTiff;
|
||||
|
Loading…
x
Reference in New Issue
Block a user