mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Fallback on DeviceGray when a colorspace cannot be parsed
This commit is contained in:
parent
5b0e15ab18
commit
71bae38afb
1 changed files with 9 additions and 3 deletions
|
@ -396,7 +396,9 @@ class ColorSpace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new FormatError(`Unrecognized ColorSpace: ${cs.name}`);
|
// Fallback to the default gray color space.
|
||||||
|
warn(`Unrecognized ColorSpace: ${cs.name}`);
|
||||||
|
return this.singletons.gray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Array.isArray(cs)) {
|
if (Array.isArray(cs)) {
|
||||||
|
@ -474,10 +476,14 @@ class ColorSpace {
|
||||||
const range = params.getArray("Range");
|
const range = params.getArray("Range");
|
||||||
return new LabCS(whitePoint, blackPoint, range);
|
return new LabCS(whitePoint, blackPoint, range);
|
||||||
default:
|
default:
|
||||||
throw new FormatError(`Unimplemented ColorSpace object: ${mode}`);
|
// Fallback to the default gray color space.
|
||||||
|
warn(`Unimplemented ColorSpace object: ${mode}`);
|
||||||
|
return this.singletons.gray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new FormatError(`Unrecognized ColorSpace object: ${cs}`);
|
// Fallback to the default gray color space.
|
||||||
|
warn(`Unrecognized ColorSpace object: ${cs}`);
|
||||||
|
return this.singletons.gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue