Merge pull request #9729 from Snuffleupagus/gulp-image_decoders

Add a `gulp image_decoders` command to package the image decoders (i.e. jpg.js, jpx.js, jbig2.js) separately, and publish them in pdfjs-dist
This commit is contained in:
Tim van der Meij 2018-06-26 23:27:32 +02:00 committed by GitHub
commit 14b69a4c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 288 additions and 14 deletions

View file

@ -147,6 +147,11 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
// Support: IE, Safari<8, Chrome<32
(function checkPromise() {
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('IMAGE_DECODERS')) {
// The current image decoders are synchronous, hence `Promise` shouldn't
// need to be polyfilled for the IMAGE_DECODERS build target.
return;
}
if (globalScope.Promise) {
return;
}
@ -166,6 +171,11 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
(function checkURLConstructor() {
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('IMAGE_DECODERS')) {
// The current image decoders doesn't utilize the `URL` constructor, hence
// it shouldn't need to be polyfilled for the IMAGE_DECODERS build target.
return;
}
// feature detect for URL constructor
var hasWorkingUrl = false;
try {