Refactor resizeImage method (#7236)

- Use URL.createObjectURL (replace from FileReader)
- Use HTMLCanvasElement.prototype.toBlob
  (replace from HTMLCanvasElement.prototype.toDataURL)
- Use Promise (replace callback interface)
This commit is contained in:
Yamagishi Kazutoshi authored and Eugen Rochko committed 2018-04-23 09:15:51 +02:00
1 parent 660cb058e1
commit 0758b00bfd
7 files changed
+120 -95

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
export const decode = base64 => {
const rawData = window.atob(base64);
const outputArray = new Uint8Array(rawData.length);
for (let i = 0; i < rawData.length; ++i) {
outputArray[i] = rawData.charCodeAt(i);
}
return outputArray;
};