Remove atob and btoa, it's already in base64

This commit is contained in:
Dávid Szabó 2016-09-23 14:33:41 +02:00 committed by Julian Descottes
parent 26b3cf3a23
commit 4cc434edd6
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@
for (j = 0; j < dataUriLength; j++) { for (j = 0; j < dataUriLength; j++) {
dataUri += String.fromCharCode(arr8[(layerStartIndex + 5 + layerNameLength) * 2 + j]); dataUri += String.fromCharCode(arr8[(layerStartIndex + 5 + layerNameLength) * 2 + j]);
} }
dataUri = 'data:image/png;base64,' + btoa(dataUri); dataUri = 'data:image/png;base64,' + dataUri;
layerStartIndex += Math.ceil(5 + layerNameLength + (dataUriLength / 2)); layerStartIndex += Math.ceil(5 + layerNameLength + (dataUriLength / 2));

View File

@ -88,7 +88,7 @@
var framesData = []; var framesData = [];
for (i = 0, layers = piskel.getLayers(); i < layers.length; i++) { for (i = 0, layers = piskel.getLayers(); i < layers.length; i++) {
var renderer = new pskl.rendering.FramesheetRenderer(layers[i].getFrames()); var renderer = new pskl.rendering.FramesheetRenderer(layers[i].getFrames());
dataUri = atob(renderer.renderAsCanvas().toDataURL().split(',')[1]); dataUri = renderer.renderAsCanvas().toDataURL().split(',')[1];
dataUriLength = dataUri.length; dataUriLength = dataUri.length;
framesData.push({uri: dataUri, length: dataUriLength}); framesData.push({uri: dataUri, length: dataUriLength});
} }