mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Use promises to track completion of decoding.
This commit is contained in:
parent
7d1cddf371
commit
683f64d54f
3 changed files with 75 additions and 46 deletions
|
@ -219,10 +219,8 @@ var PartialEvaluator = (function partialEvaluator() {
|
|||
}
|
||||
|
||||
fn = 'paintImageXObject';
|
||||
var imageObj = new PDFImage(xref, resources, image, inline, handler);
|
||||
|
||||
imageObj.ready((function() {
|
||||
return function(data) {
|
||||
PDFImage.buildImage(function(imageObj) {
|
||||
var imgData = {
|
||||
width: w,
|
||||
height: h,
|
||||
|
@ -231,8 +229,7 @@ var PartialEvaluator = (function partialEvaluator() {
|
|||
var pixels = imgData.data;
|
||||
imageObj.fillRgbaBuffer(pixels, imageObj.decode);
|
||||
handler.send('obj', [objId, 'Image', imgData]);
|
||||
};
|
||||
})(objId));
|
||||
}, handler, xref, resources, image, inline);
|
||||
}
|
||||
|
||||
uniquePrefix = uniquePrefix || '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue