From 4cc434edd6b5503ff60524303eece34d74ef9d40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Szab=C3=B3?= Date: Fri, 23 Sep 2016 14:33:41 +0200 Subject: [PATCH] Remove atob and btoa, it's already in base64 --- src/js/utils/serialization/Deserializer.js | 2 +- src/js/utils/serialization/Serializer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/utils/serialization/Deserializer.js b/src/js/utils/serialization/Deserializer.js index 35d630bb..19c57fa2 100644 --- a/src/js/utils/serialization/Deserializer.js +++ b/src/js/utils/serialization/Deserializer.js @@ -108,7 +108,7 @@ for (j = 0; j < dataUriLength; 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)); diff --git a/src/js/utils/serialization/Serializer.js b/src/js/utils/serialization/Serializer.js index a0c11e52..cd0f8f03 100644 --- a/src/js/utils/serialization/Serializer.js +++ b/src/js/utils/serialization/Serializer.js @@ -88,7 +88,7 @@ var framesData = []; for (i = 0, layers = piskel.getLayers(); i < layers.length; i++) { 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; framesData.push({uri: dataUri, length: dataUriLength}); }