1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Inline JpegImageLoader to remove new JpegImageLoader call

This commit is contained in:
Julian Viereck 2011-12-05 17:59:03 +01:00
parent 685a263e54
commit 97802aac64
4 changed files with 14 additions and 35 deletions

View file

@ -560,8 +560,15 @@ var PDFDoc = (function pdfDoc() {
switch (type) {
case 'JpegStream':
var IR = data[2];
new JpegImageLoader(id, IR, this.objs);
var imageData = data[2];
var src = 'data:image/jpeg;base64,' + window.btoa(imageData);
var img = new Image();
img.onload = (function jpegImageLoaderOnload() {
this.objs.resolve(id, img);
}).bind(this);
img.src = src;
break;
case 'Font':
var name = data[2];