Uses blob URL instead of data when possible

This commit is contained in:
Yury Delendik 2013-11-11 22:25:03 -06:00 committed by Yury
parent 4ce6cb8b0f
commit c8af2565f1
3 changed files with 34 additions and 8 deletions

View file

@ -815,7 +815,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, this);
messageHandler.on('JpegDecode', function(data, promise) {
var imageData = data[0];
var imageUrl = data[0];
var components = data[1];
if (components != 3 && components != 1)
error('Only 3 component or 1 component can be returned');
@ -845,8 +845,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
}
promise.resolve({ data: buf, width: width, height: height});
}).bind(this);
var src = 'data:image/jpeg;base64,' + window.btoa(imageData);
img.src = src;
img.src = imageUrl;
});
},