diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 44c779265886d..b189f5d18665b 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -579,7 +579,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { return this._sendImgData(objId, imgData, cacheGlobally); }) .catch(reason => { - warn("Unable to decode image: " + reason); + warn(`Unable to decode image "${objId}": "${reason}".`); return this._sendImgData(objId, /* imgData = */ null, cacheGlobally); }); diff --git a/src/core/image.js b/src/core/image.js index bab5affa0e4f5..5c5bc15bc4586 100644 --- a/src/core/image.js +++ b/src/core/image.js @@ -248,7 +248,7 @@ var PDFImage = (function PDFImageClosure() { * Handles processing of image data and returns the Promise that is resolved * with a PDFImage when the image is ready to be used. */ - PDFImage.buildImage = function ({ + PDFImage.buildImage = async function ({ xref, res, image, @@ -271,17 +271,16 @@ var PDFImage = (function PDFImageClosure() { warn("Unsupported mask format."); } } - return Promise.resolve( - new PDFImage({ - xref, - res, - image: imageData, - isInline, - smask: smaskData, - mask: maskData, - pdfFunctionFactory, - }) - ); + + return new PDFImage({ + xref, + res, + image: imageData, + isInline, + smask: smaskData, + mask: maskData, + pdfFunctionFactory, + }); }; PDFImage.createMask = function ({ diff --git a/test/pdfs/issue6707.pdf.link b/test/pdfs/issue6707.pdf.link new file mode 100644 index 0000000000000..1a38b107b6b18 --- /dev/null +++ b/test/pdfs/issue6707.pdf.link @@ -0,0 +1 @@ +https://web.archive.org/web/20151201202008/https://secure.dynaccount.com/data/voucher/30000/400/30452_93e074c4c8b2301a24b33176331c49e5755e02fa.pdf diff --git a/test/test_manifest.json b/test/test_manifest.json index b0b29be848983..db8b70ee4f3c6 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -669,6 +669,14 @@ "lastPage": 1, "type": "eq" }, + { "id": "issue6707", + "file": "pdfs/issue6707.pdf", + "md5": "068ceaec23d265b1d38dfa6ab279f017", + "rounds": 1, + "link": true, + "lastPage": 1, + "type": "eq" + }, { "id": "issue6721_reduced", "file": "pdfs/issue6721_reduced.pdf", "md5": "719aa66d8081a15e3ba6032ed4279237",