mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Refactors buildImage to use Promise; don't draw bad images
This commit is contained in:
parent
347a38a129
commit
a00f854848
4 changed files with 42 additions and 35 deletions
|
@ -1824,7 +1824,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
paintJpegXObject: function CanvasGraphics_paintJpegXObject(objId, w, h) {
|
||||
var domImage = this.objs.get(objId);
|
||||
if (!domImage) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
warn('Dependent image isn\'t ready yet');
|
||||
return;
|
||||
}
|
||||
|
||||
this.save();
|
||||
|
@ -1958,7 +1959,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
paintImageXObject: function CanvasGraphics_paintImageXObject(objId) {
|
||||
var imgData = this.objs.get(objId);
|
||||
if (!imgData) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
warn('Dependent image isn\'t ready yet');
|
||||
return;
|
||||
}
|
||||
|
||||
this.paintInlineImageXObject(imgData);
|
||||
|
@ -1969,7 +1971,8 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
|
|||
positions) {
|
||||
var imgData = this.objs.get(objId);
|
||||
if (!imgData) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
warn('Dependent image isn\'t ready yet');
|
||||
return;
|
||||
}
|
||||
|
||||
var width = imgData.width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue