mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Simplify the check, and remove the warning, for the nativeImageDecoderSupport
API parameter
As discussed in PR 8982.
This commit is contained in:
parent
bcb29063c1
commit
b5794bb26b
1 changed files with 3 additions and 7 deletions
|
@ -223,13 +223,9 @@ function getDocument(src) {
|
|||
params.rangeChunkSize = params.rangeChunkSize || DEFAULT_RANGE_CHUNK_SIZE;
|
||||
params.ignoreErrors = params.stopAtErrors !== true;
|
||||
|
||||
params.nativeImageDecoderSupport = params.nativeImageDecoderSupport ||
|
||||
NativeImageDecoding.DECODE;
|
||||
if (params.nativeImageDecoderSupport !== NativeImageDecoding.DECODE &&
|
||||
params.nativeImageDecoderSupport !== NativeImageDecoding.NONE &&
|
||||
params.nativeImageDecoderSupport !== NativeImageDecoding.DISPLAY) {
|
||||
warn('Invalid parameter nativeImageDecoderSupport: ' +
|
||||
'need a state of enum {NativeImageDecoding}');
|
||||
const nativeImageDecoderValues = Object.values(NativeImageDecoding);
|
||||
if (params.nativeImageDecoderSupport === undefined ||
|
||||
!nativeImageDecoderValues.includes(params.nativeImageDecoderSupport)) {
|
||||
params.nativeImageDecoderSupport = NativeImageDecoding.DECODE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue