回答編集履歴
3
shuusei
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
const getBase64ImageFromUrl=async(imageUrl)=>
|
4
4
|
|
5
|
-
new Promise(
|
5
|
+
new Promise(resolve=>
|
6
6
|
|
7
7
|
fetch(imageUrl).then(res=>res.blob()).then(blob=>{
|
8
8
|
|
2
typo
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
(async()=>{
|
26
26
|
|
27
|
-
cos
|
27
|
+
const url='/image.png';
|
28
28
|
|
29
29
|
console.log(await getBase64ImageFromUrl(url));
|
30
30
|
|
1
chousei
test
CHANGED
@@ -8,11 +8,11 @@
|
|
8
8
|
|
9
9
|
const reader = new FileReader();
|
10
10
|
|
11
|
-
reader.
|
11
|
+
reader.addEventListener('load',()=>{
|
12
12
|
|
13
13
|
resolve(reader.result);
|
14
14
|
|
15
|
-
};
|
15
|
+
});
|
16
16
|
|
17
17
|
reader.readAsDataURL(blob);
|
18
18
|
|