回答編集履歴

1

チョウセイ

2019/09/30 05:03

投稿

yambejp
yambejp

スコア114839

test CHANGED
@@ -12,25 +12,17 @@
12
12
 
13
13
  var t=e.target;
14
14
 
15
- fetch(t.src).then(res=>{
15
+ fetch(t.src).then(res=>new Promise(resolve=>resolve(res.blob())).then(blob=>new Object({
16
16
 
17
- new Promise(resolve=>resolve(res.blob())).then(blob=>{
17
+ type:res.headers.get("content-type"),
18
18
 
19
- console.log({
19
+ size:blob.size,
20
20
 
21
- type:res.headers.get("content-type"),
21
+ width:t.naturalWidth,
22
22
 
23
- size:blob.size,
23
+ height:t.naturalHeight,
24
24
 
25
- width:t.naturalWidth,
26
-
27
- height:t.naturalHeight,
25
+ }))).then(console.log);
28
-
29
- });
30
-
31
- });
32
-
33
- });
34
26
 
35
27
  });
36
28