回答編集履歴
1
誤りを訂正
answer
CHANGED
@@ -11,8 +11,8 @@
|
|
11
11
|
const picture = await this.getBase64(file)
|
12
12
|
const binary = window.atob(picture.split(',')[1]) // バイナリ ←必要なのはこれ?
|
13
13
|
const arr = new TextEncoder().encode(binary) // typedArray
|
14
|
-
const blb = new Blob(arr, { type: 'image/png' }) // blob ←必要なのはこれ?
|
14
|
+
const blb = new Blob([arr.buffer], { type: 'image/png' }) // blob ←必要なのはこれ?
|
15
|
-
const picture2 = await this.getBase64(
|
15
|
+
const picture2 = await this.getBase64(blb) // dataURL に戻すと
|
16
16
|
console.log(picture === picture2) // 一致する
|
17
17
|
}
|
18
18
|
```
|