mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Fix sending image data to main thread
This commit is contained in:
parent
78129970c6
commit
37ee56a705
3 changed files with 8 additions and 6 deletions
|
@ -71,7 +71,7 @@ function WorkerPDFDoc(canvas) {
|
|||
"$drawImage": function(id, x, y, sx, sy, swidth, sheight) {
|
||||
var image = imagesList[id];
|
||||
if (!image) {
|
||||
throw "Image not found";
|
||||
throw "Image not found: " + id;
|
||||
}
|
||||
this.drawImage(image, x, y, image.width, image.height,
|
||||
sx, sy, swidth, sheight);
|
||||
|
@ -179,9 +179,8 @@ function WorkerPDFDoc(canvas) {
|
|||
|
||||
"jpeg_stream": function(data) {
|
||||
var img = new Image();
|
||||
img.src = "data:image/jpeg;base64," + window.btoa(data);
|
||||
img.src = "data:image/jpeg;base64," + window.btoa(data.raw);
|
||||
imagesList[data.id] = img;
|
||||
console.log("got image", data.id)
|
||||
},
|
||||
|
||||
"canvas_proxy_cmd_queue": function(data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue