<canvas>
ïŒãªã©ã®èŠçŽ ããããŸãã ç»åãåžæã®ãµã€ãºã«é©çšã§ããŸãã 5è¡ã®ã³ãŒããšç»åã®æºåãã§ããŸããïŒ
function resize(img, w, h) { var canvas = document.createElement('canvas'); canvas.width = w; canvas.height = h; canvas.getContext('2d').drawImage(img, 0, 0, w, h); return canvas; }
ãã£ã³ãã¹ãããç»åãJPEGã§ä¿åããããšãã°ãµãŒããŒã«éä¿¡ã§ããŸãã ãã®èšäºãçµäºããããšã¯ã§ããŸããããæåã«çµæãèŠãŠã¿ãŸãããã ãã®ãããªãã£ã³ãã¹ããã®é£ã«é 眮ããåãç»åãããŒããããéåžžã®
<img>
èŠçŽ ïŒ source ã4 MBïŒãé 眮ãããšãéããããããŸãã
äœããã®çç±ã§ããã¹ã¯ããããšã¢ãã€ã«ã®äž¡æ¹ã®ææ°ã®ãã©ãŠã¶ãŒã¯ãã¹ãŠãã¢ãã£ã³å€æã®å®äŸ¡ãªæ¹æ³ã䜿çšããŠãã£ã³ãã¹ã«æç»ããŸãã ç»åã®ãµã€ãºå€æŽæ¹æ³ã®éãã¯ã 察å¿ããèšäºã§æ¢ã«èª¬æããŸããã ã¢ãã£ã³å€æã®æ¹æ³ã®æ¬è³ªãæãåºãããŠãã ããã ãã®äžã§ãæçµç»åã®åãã€ã³ããèšç®ããããã«ããœãŒã¹ã®4ãã€ã³ããè£éãããŸãã ããã¯ãç»åã2å以äžçž®å°ããããšãå ã®ç»åã«ç©Žã圢æãããããšãæå³ããŸããæçµçãªç»åã§ã¯ãŸã£ããèæ ®ãããªããã¯ã»ã«ã§ãã å質ãäœäžããã®ã¯ããããã®èª¬æãããŠããªããã¯ã»ã«ã®ããã§ãã
ãã¡ããããã®åœ¢åŒã®åçã¯ããŸãšããªäººã«ã¯èŠããããŸããã åœç¶ã®ããšãªããããã£ã³ãã¹ã䜿çšããå質ã®ãµã€ãºå€æŽã®åé¡ã¯ãstackoverflowã§ããå°ããããŸãã æãäžè¬çãªãã³ãã¯ãæ°ã¹ãããã§ç»åãçž®å°ããããšã§ãã 確ãã«ã 匷åãªç»åçž®å°ããã¹ãŠã®ãã¯ã»ã«ããã£ããã£ããªãå Žåãç»åããããã«çž®å°ããªãã®ã¯ãªãã§ãã ã ãããŠãç®çã®ãµã€ãºã«ãªããŸã§äœåºŠãç¹°ãè¿ããŸãã ãã®äŸã®ããã« ã
ééããªããå ã®ç»åã®ãã¹ãŠã®ãã€ã³ãããã¡ã€ãã«ã§èæ ®ãããããããã®æ¹æ³ã¯ã¯ããã«åªããçµæããããããŸãã å¥ã®è³ªåã¯ãããããã©ã®ããã«æ£ç¢ºã«èæ ®ããããã§ãã æ¢ã«ã¹ããããµã€ãºãåæãµã€ãºãæçµç»åã®ãµã€ãºã«äŸåããŠããŸãã ããšãã°ãã¹ããããµã€ãºãæ£ç¢ºã«2ã«ãããšããããã®åæžã¯ã¹ãŒããŒãµã³ããªã³ã°ãšåçã«ãªããŸãã ãããŠããããæåŸã®ã¹ãããã§ã-ãªããŠå¹žéãã å®å šã«å¹žéãªå ŽåãæåŸã®ã¹ãããã2ã«ãªããŸããããããæåŸã®ã¹ãããã§ç»åã1ãã¯ã»ã«çž®å°ããå¿ èŠããããç»åãç³é¹žã®ããã«ãªãå Žåã¯ããŸã£ãã幞éã§ã¯ãããŸããã æ¯èŒãããšããµã€ãºã®éãã¯1ãã¯ã»ã«ã®ã¿ã§ãéãã¯äœã§ããïŒ ãœãŒã¹ ã4 MBïŒïŒ
ããããããããããªãã¯å®å šã«ç°ãªãæ¹æ³ãè©ŠããŠã¿ãã¹ãã§ããïŒ ãã¯ã»ã«ãååŸãããã£ã³ãã¹ãããããµã€ãºå€æŽã®ã¿ã¹ã¯ã«ç°¡åã«å¯Ÿå¿ã§ããè¶ é«éã®JavaScriptããããŸãã ãããã£ãŠããã©ãŠã¶ã®ãµããŒãã«äŸåããããšãªããä»»æã®ãµã€ãºå€æŽã¡ãœãããèªåã§å®è£ ã§ããŸãã ããšãã°ã ã¹ãŒããŒãµã³ããªã³ã°ãŸãã¯ç³ã¿èŸŒã¿ ã
ããšã¯ããã«ãµã€ãºã®ç»åããã£ã³ãã¹ã«ã¢ããããŒãããã ãã§ãã ããã¯çæ³çãªã±ãŒã¹ã®ããã«èŠããã§ãããã
resizePixels
ã®å®è£ ã¯ãªãã¹ã¯ãªãŒã³ã®
resizePixels
ããŸãã
function resizeImage(image, width, height) { var cIn = document.createElement('canvas'); cIn.width = image.width; cIn.height = image.height; var ctxIn = cIn.getContext('2d'); ctxIn.drawImage(image, 0, 0); var dataIn = ctxIn.getImageData(0, 0, image.width, image.heigth); var dataOut = ctxIn.createImageData(width, heigth); resizePixels(dataIn, dataOut); var cOut = document.createElement('canvas'); cOut.width = width; cOut.height = height; cOut.getContext('2d').putImageData(dataOut, 0, 0); return cOut; }
ããã¯äžèŠãããšãããšãŠãã€ãŸããªããŠéå±ã§ãã åµã®æ å ããã©ãŠã¶éçºè ã¯éå±ãããŸããã ãããããã¡ãããã®ã³ãŒãã¯å Žåã«ãã£ãŠã¯æ©èœããŸãã ãã£ããã¯äºæããªãå Žæã«ãããŸãã
ã¯ã©ã€ã¢ã³ãã§ãµã€ãºãå€æŽããå¿ èŠãããçç±ã«ã€ããŠèª¬æããŸãããã ãµãŒããŒã«éä¿¡ããåã«ãéžæããåçã®ãµã€ãºãå°ããããŠããŠãŒã¶ãŒã®ãã©ãã£ãã¯ãç¯çŽããã¿ã¹ã¯ããããŸããã ããã¯ãæ¥ç¶ãé ãããã©ãã£ãã¯ãææã®ã¢ãã€ã«ããã€ã¹ã§æãé¢é£æ§ããããŸãã ãããŠããã®ãããªããã€ã¹ã«æãããããŠã³ããŒããããåçã¯äœã§ããïŒ ãããã®ã¢ãã€ã«ããã€ã¹ã®ã«ã¡ã©ã§æ®åœ±ã ã«ã¡ã©ã®è§£å床ãããšãã°ãiPhone-8ã¡ã¬ãã¯ã»ã«ã ããããããã䜿ãã°ã25ã¡ã¬ãã¯ã»ã«ã®ããã©ããæ®ãããšãã§ããŸãïŒiPhone 6ã§ã¯ããã«ïŒã Androidããã³Windows Phoneã§ã¯ãã«ã¡ã©ã®è§£å床ã¯ããã«é«ããªããŸãã ãããŠãããã§ãããã®ã¢ãã€ã«ããã€ã¹ã®å¶éã«çŽé¢ããŠããŸãã æ®å¿µãªããã iOSã§ã¯5ã¡ã¬ãã¯ã»ã«ãè¶ ãããã£ã³ãã¹ãäœæã§ããŸãã ã
Appleã¯ç解ã§ããŸãããéããããªãœãŒã¹ã§ããã€ã¹ã®æ£åžžãªåäœãç£èŠããå¿ èŠããããŸãã å®éãäžèšã®é¢æ°ã§ã¯ãå šäœåã3åã¡ã¢ãªãå æããŸãïŒ Once-Imageãªããžã§ã¯ãã«é¢é£ä»ãããããããã¡ãŒãã€ã¡ãŒãžã¯å±éããã2åç®-ãã£ã³ãã¹ãã¯ã»ã«ã3åç®-ImageDataã®åä»ãé åã 8ã¡ã¬ãã¯ã»ã«ã®ç»åã®å Žåã25ã¡ã¬ãã¯ã»ã«-300ã®å Žåã8Ã3Ã4 = 96ã¡ã¬ãã€ãã®ã¡ã¢ãªãå¿ èŠã§ãã
ãããããã¹ãããã»ã¹ã§ã¯ãiOSã ãã§ãªãåé¡ã«ééããŸããã Macäžã®Chromeã¯ã1ã€ã®å€§ããªç»åã®ä»£ããã«ããã€ãã®å°ããªç»åãæç»ããããã«ãªããWindowsã§ã¯çœãã·ãŒãã衚瀺ãããŸããã
ããããäžåºŠã«ãã¹ãŠã®ãã¯ã»ã«ãååŸããããšã¯ã§ããªãã®ã§ãããããéšåçã«ååŸã§ããŸããïŒ å¹ ãå ã®ç»åã®å¹ ã«çãããé«ããã¯ããã«å°ããæçã§ãã£ã³ãã¹ã«ç»åãããŒãã§ããŸãã æåã«æåã®5ã¡ã¬ãã¯ã»ã«ãããŒããã次ã«ãã1ã€ãããŒãããŠãããæ®ãã®éãããŒãããŸãã ãŸãã¯2ã¡ã¬ãã¯ã»ã«ã§ãããã¡ã¢ãªäœ¿çšéãããã«åæžããŸãã 幞ããªããšã«ã2ãã¹ã³ã³ããªã¥ãŒã·ã§ã³ã®ãµã€ãºå€æŽãšã¯ç°ãªããã¹ãŒããŒãµã³ããªã³ã°ã®ãµã€ãºå€æŽæ¹æ³ã¯ã·ã³ã°ã«ãã¹ã§ãã ã€ãŸã ç»åãåå²ããŠåä¿¡ã§ããã ãã§ãªããäžåºŠã«1ã€ãã€éä¿¡ããŠåŠçããããšãã§ããŸãã ã¡ã¢ãªã¯ãImageèŠçŽ ããã£ã³ãã¹ïŒ2ã¡ã¬ãã¯ã»ã«ãªã©ïŒãããã³åä»ãé åã«ã®ã¿å¿ èŠã§ãã ã€ãŸã åçã®å Žåã8ã¡ã¬ãã¯ã»ã«ïŒ8 + 2 + 2ïŒÃ4 = 48ã¡ã¬ãã€ããã€ãŸã2åå°ãªãã
äžèšã®ã¢ãããŒããå®è£ ããåéšåã®ã©ã³ã¿ã€ã ã枬å®ããŸããã ããã§èªåèªèº«ããã¹ãã§ããŸã ã ããã¯ã10,800Ã2,332ãã¯ã»ã«ã®è§£å床ã®ç»åïŒiPhoneã®ããã©ãïŒã§åŸããã®ã§ãã
ãã©ãŠã¶ | Safari 8 | Chrome 40 | Firefox 35 | IE 11 |
---|---|---|---|---|
ç»åã®èªã¿èŸŒã¿ | 24ããªç§ | 27 | 28 | 76 |
ãã£ã³ãã¹ã«æã | 1 | 348 | 278 | 387 |
ç»åããŒã¿ãååŸãã | 304 | 299 | 165 | 320 |
Jsãµã€ãºå€æŽ | 233 | 135 | 138 | 414 |
ããŒã¿ãæ»ã | 1 | 1 | 3 | 5 |
ç»åããããååŸãã | 10 | 16 | 21 | 19 |
åèš | 576 | 833 | 641 | 1243 |
ããã¯éåžžã«èå³æ·±ãããŒãã«ã§ãã詳ããèŠãŠãããŸãããã çŽ æŽããããã¥ãŒã¹ã¯ãjavascriptã§ã®ãµã€ãºå€æŽèªäœãããã«ããã¯ã§ã¯ãªãããšã§ãã ã¯ããSafariã§ã¯ChromeãšFirefoxãã1.7åé ããIEã§ã¯3åé ããªããŸããããã¹ãŠã®ãã©ãŠã¶ã§ç»åãããŠã³ããŒãããŠããŒã¿ãåä¿¡ããæéã¯ããã«é·ããªããŸãã
2çªç®ã®æ³šç®ãã¹ãç¹ã¯ããã©ãŠã¶ã§ã¯ç»åã
image.onload
ã€ãã³ãçšã«ãã³ãŒããããªãããšã§ãã ãã³ãŒãã¯ãæ¬åœã«å¿ èŠãªãšããŸã§å»¶æãããŸã-ç»é¢ã«è¡šç€ºãããããã£ã³ãã¹ã«è¡šç€ºããŸãã ãŸããSafariã§ã¯ããã£ã³ãã¹ãç»é¢ã«è¡šç€ºãããªãããããã£ã³ãã¹ã«é©çšããŠãç»åã¯ãã³ãŒããããŸããã ãŸãããã¯ã»ã«ããã£ã³ãã¹ããåé€ãããå Žåã«ã®ã¿ãã³ãŒããããŸãã
è¡šã¯ããŒã¿ã®æç»ãšåä¿¡ã®åèšæéã瀺ããŠããŸãããå®éã«ã¯ãããã®æäœã¯2ã¡ã¬ãã¯ã»ã«ããšã«è¡ãããäžèšã®ãªã³ã¯ã䜿çšããã¹ã¯ãªããã¯åå埩ã®æéãåå¥ã«è¡šç€ºããŸãã ãããã®ã€ã³ãžã±ãŒã¿ãèŠããšãSafariãChromeãããã³IEã®ããŒã¿ãåä¿¡ããåèšæéãã»ãŒåãã§ããã«ãããããããSafariã§ã¯ãã»ãšãã©ã®å Žåãæåã®åŒã³åºãã ãã§ç»åããã³ãŒããããChromeãšIEã®æââéã¯ãã¹ãŠã®åŒã³åºãã§åãã§ãããããŒã¿åä¿¡ã®äžè¬çãªé床äœäžã瀺ããŠããŸãã Firefoxã«ã€ããŠãåãããšãèšããŸãããçšåºŠã¯å£ããŸãã
ãããŸã§ã®ãšããããã®ã¢ãããŒãã¯ææã«èŠããŸãã ã¢ãã€ã«ããã€ã¹ã§ãã¹ãããŸãããã ç§ã®æå ã«ã¯ãiPhone 4sïŒi4sïŒãiPhone 5ïŒi5ïŒãMeizu MX4 ProïŒAïŒãããããªã¬ã°ã³ã«ãµã³ã¹ããŒã«Windows Phoneã§ã®ãã¹ããäŸé ŒãããšãããHTC 8xïŒWïŒã§ããããšãå€æããŸããã
ãã©ãŠã¶ | Safari i4 | Safari i5 | Chrome i4s | Chrome a | Chrome a | Firefox a | IE W |
---|---|---|---|---|---|---|---|
ç»åã®èªã¿èŸŒã¿ | 517ããªç§ | 137 | 650 | 267 | 220 | 81 | 437 |
ãã£ã³ãã¹ã«æã | 2 706 | 959 | 2 725 | 1 108 | 6 954 | 1 007 | 1 019 |
ç»åããŒã¿ãååŸãã | 678 | 250 | 734 | 373 | 543 | 406 | 1,783 |
Jsãµã€ãºå€æŽ | 2 939 | 1,110 | 96,320 | 491 | 458 | 418 | 2,299 |
ããŒã¿ãæ»ã | 9 | 5 | 315 | 6 | 4 | 14 | 24 |
ç»åããããååŸãã | 98 | 46 | 187 | 37 | 41 | 80 | 33 |
åèš | 6,995 | 2,524 | 101 002 | 2,314 | 8 242 | 2,041 | 5,700 |
æåã«ç®ãåŒãã®ã¯ãiOSäžã®Chromeã®ãé¡èãªãçµæã§ãã 確ãã«ãæè¿ãŸã§ãiOSã§ã¯ããã¹ãŠã®ãµãŒãããŒãã£ãã©ãŠã¶ãŒã¯jitã³ã³ãã€ã«ãªãã§ããŒãžã§ã³ã®ãšã³ãžã³ã§ããåäœããŸããã§ããã iOS 8ã§ã¯ãjitã䜿çšã§ããããã«ãªããŸããããChromeã¯ãŸã é©å¿ã§ããŠããŸããã
ãã1ã€ã®å¥åŠãªç¹ã¯ãAndroidäžã®Chromeã®2ã€ã®çµæã§ããæç»æéã¯æ ¹æ¬çã«ç°ãªããä»ã®ãã¹ãŠã§ã»ãŒåãã§ãã ããã¯ããŒãã«ã®ééãã§ã¯ãªããChromeã¯å®éã«ç°ãªãåäœãããå¯èœæ§ããããŸãã ãã©ãŠã¶ãŒã¯ãå¿ èŠãšå€æããæç¹ã§ãç»åãé 延çã«èªã¿èŸŒããšæ¢ã«è¿°ã¹ãŸããã ãã®ãããç»åãäžèŠã«ãªã£ããšå€æããå Žåããã©ãŠã¶ã¯ç»åãå æããŠããã¡ã¢ãªã解æŸããããšã劚ãããã®ã¯ãããŸããã åœç¶ã次ã«ãã£ã³ãã¹ã«æç»ãããšãã«ç»åãåã³å¿ èŠã«ãªã£ãå Žåãå床ãã³ãŒãããå¿ èŠããããŸãã ãã®å Žåãç»åã¯7åãã³ãŒããããŸããã ããã¯ãåã ã®ãã£ã³ã¯ãæç»ããæéã§æ確ã«èŠãããšãã§ããŸãïŒè¡šã§ã¯åèšæéã®ã¿ãæãåºããŸãïŒã ãã®ãããªç¶æ³ã§ã¯ããã³ãŒãæéãäºæž¬äžèœã«ãªããŸãã
æ²ããããªããããã¯ãã¹ãŠã®åé¡ã§ã¯ãããŸããã ãšã¯ã¹ãããŒã©ãŒã§ããªãã®è³ãç²ã«ããŠããããšãèªããªããã°ãªããŸããã å®éã«ã¯ããã£ã³ãã¹ã®å蟺ã®ãµã€ãºã«ã¯4096ãã¯ã»ã«ã®å¶éããããŸãã ãŸãããããã®å¶éãè¶ ããç»åã®äžéšã¯ãéæãªé»ããã¯ã»ã«ã«ãªããŸãã æ倧ãã£ã³ãã¹é åã®å¶éããã€ãã¹ããã®ãéåžžã«ç°¡åã§ãç»åãæ°Žå¹³ã«ã«ããããŠã¡ã¢ãªãç¯çŽããå Žåãå¹ å¶éããã€ãã¹ããã«ã¯ããµã€ãºå€æŽæ©èœãå€§å¹ ã«ããçŽãããé£æ¥ããããŒã¹ãã¹ããªããã«æ¥çããå¿ èŠããããŸãããããã¯ã¡ã¢ãªæ¶è²»ãå¢ããã ãã§ãã
ãã®æç¹ã§ãç§ã¯ãã®åé¡ãåãåºãããšã«ããŸããã ãµã€ãºãå€æŽããã ãã§ãªããã¯ã©ã€ã¢ã³ãã§jpegããã³ãŒãããå®å šã«ã¯ã¬ã€ãžãŒãªãªãã·ã§ã³ããããŸããã çæïŒjpegã®ã¿ãChromeã®iOSã«ãšã£ãŠã®æªãæéã¯ããã«æªåããŸãã é·æïŒAndroidã§ã®Chromeã§ã®äºæž¬å¯èœæ§ããµã€ãºå¶éãªããå¿ èŠãªã¡ã¢ãªã®åæžïŒãã£ã³ãã¹ãžã®ç¡éã®ã³ããŒãªãïŒã çŽç²ãªjavascriptã«ã¯jpegãã³ãŒããŒããããŸãããç§ã¯ãã®ãªãã·ã§ã³ããããŠããŸããã§ããã
ããŒã2.æåã«æ»ã
æåã®æ®µéã§ãæé«ã®å Žåã¯2åããããŠææªã®å Žåã¯ç³é¹žã®é£ç¶çãªæžå°ãšããè¯ãçµæãåŸãããããšãæãåºããŠãã ããã ããããã¢ãããŒããããŸãå€ããã«ææªã®ãªãã·ã§ã³ãåãé€ãããšãããšã©ããªãã§ããããïŒ æåŸã®ã¹ãããã§åçãå°ãæžããå¿ èŠãããå Žåãç³é¹žãåŸãããããšãæãåºãããŠãã ããã æåŸã®ã¹ããããæåã«å®è¡ãããæåã«äžç¹å®ã®åæ°ã ãæžå°ãããã®åŸå³å¯ã«2åã ãæžå°ããå Žåã¯ã©ããªããŸããïŒ éäžã§ãæåã®ã¹ãããã¯ãé¢ç©ã5ã¡ã¬ãã¯ã»ã«ãå¹ ã4096ãã¯ã»ã«ä»¥äžã§ããããšãèæ ®ããå¿ èŠããããŸãã ãã®å Žåã ã³ãŒãã¯æããã«æåã§ãµã€ãºå€æŽãããããç°¡åã§ãã
å·ŠåŽã§ã¯ãç»åã¯4段éã§çž®å°ãããå³åŽã§ã¯5段éã§çž®å°ãããã»ãšãã©éãã¯ãããŸããã ã»ãŒåå©ã æ®å¿µãªããã2ã€ãš3ã€ã®ã¹ãããã®éãïŒ1ã€ãš2ã€ã®ã¹ãããã®éãã¯èšããŸã§ããããŸããïŒã¯ããŸã éåžžã«ã¯ã£ãããšèŠããŸãã
ç³é¹žã¯æåã®é ãããã¯ããã«å°ãªãã§ããã å³ã®ç»åïŒ3段éã§ååŸïŒã¯ãå·Šãããå°ãèŠãç®ããããšæããŸãããããã¯ã·ã£ãŒããããŸãã
ããã§ããµã€ãºå€æŽãåŒãäžããåæã«ã¹ãããæ°ãæžãããå¹³åã¹ãããæ¯ã2ã«è¿ã¥ããããšãã§ããŸããäž»ãªããšã¯æéå ã«åæ¢ããããšã§ãã ãã©ãŠã¶ã®å¶éã«ãããåºæ¬çã«ãã£ãšè¯ãããšãããããšã¯ã§ããŸããã 次ã®ãããã¯ã«é²ã¿ãŸãããã
ããŒã3.è¡ã®å€ãã®åç
ãµã€ãºå€æŽã¯æ¯èŒçé·ãæäœã§ãã é¡ãæäœããŠãã¹ãŠã®ç»åã®ãµã€ãºã次ã ã«å€æŽãããšããã©ãŠã¶ãé·æéããªãŒãºãããŠãŒã¶ãŒãã¢ã¯ã»ã¹ã§ããªããªããŸãã ãµã€ãºå€æŽã®åã¹ãããã®åŸã«
setTimeout
ãå®è¡ããããšãã
setTimeout
ããŸãã ãã ããããã§å¥ã®åé¡ãçºçããŸãããã¹ãŠã®ç»åãåæã«ãµã€ãºå€æŽãéå§ãããšããããã®ã¡ã¢ãªãåæã«å¿ èŠã«ãªããŸãã ããã¯ããã¥ãŒãæŽçããããšã§åé¿ã§ããŸãã ããšãã°ãåã®ç»åã®ãµã€ãºå€æŽã®æåŸã«ã次ã®ç»åã®ãµã€ãºå€æŽãéå§ã§ããŸãã ãã ãããã¥ãŒãå€éšã§ã¯ãªããµã€ãºå€æŽé¢æ°ã®å éšã§åœ¢æãããå Žåã¯ãããäžè¬çãªãœãªã¥ãŒã·ã§ã³ããå§ãããŸãã ããã«ãããç°ãªãå Žæãããµã€ãºå€æŽãåæã«åŒã³åºãããå Žåã§ãã2ã€ã®ç»åãåæã«ãµã€ãºå€æŽãããªãããšãä¿èšŒãããŸãã
å®å šãªäŸã¯æ¬¡ã®ãšããã§ãã第2éšã«ãã£ããã¹ãŠã®èŠçŽ ã«å ããŠãé·ãæäœã®åã®ãã¥ãŒãšã¿ã€ã ã¢ãŠãã®å®è£ ã ããŒãžã«ã²ãããå ãããšããããã©ãŠã¶ãåããªããªã£ãå Žåããã°ããã®éã¯æããã«ãªããŸããã ã¢ãã€ã«ããã€ã¹ã§ãã¹ãããæãæ¥ãŸããïŒ
ããã§ã¯ãã¢ãã€ã«Safari 8ã«ã€ããŠäœè«ã«ããŸãïŒä»ã®ããŒãžã§ã³ã®ããŒã¿ã¯ãããŸããïŒã ãã®äžã§ãå ¥åã§ç»åãéžæãããšããã©ãŠã¶ãæ°ç§éé ããªããŸãã ããã¯ãSafariãããªãã³ã°ãããEXIFã§åçã®ã³ããŒãäœæããããå ¥åå ã«çŽæ¥è¡šç€ºãããå°ããªãã¬ãã¥ãŒãçæããããã§ãã 1æã®åçã蚱容ç¯å²å ã§ãããç®ã«èŠããªãå Žåã§ããè€æ°éžæãè¡ããšå°çã«å€ããå¯èœæ§ããããŸãïŒéžæããåçã®æ°ã«ãã£ãŠç°ãªããŸãïŒã ãã®éãããŒãžã¯åçãéžæãããŠããããšãèªèããããã¡ã€ã«éžæãã€ã¢ãã°ãéåžžéããŠããããšãããããŸããã
è¢ããŸãããiPhoneã§ããŒãžãéãã20æã®åçãéžæããŸããã å°ãèããŠãSafariã¯åãã§å ±åããŸããããã®WebããŒãžã§åé¡ãçºçãããããåèªã¿èŸŒã¿ããŸããã 2åç®ã®è©Šè¡ã¯åãçµæã§ãã 芪æãªãèªè ã®çãããç§ã¯ããªããããããŸããã§ãããªããªãããªãã«ãšã£ãŠæ¬¡ã®ãã©ã°ã©ãã¯ããã«é£ãã§ããã§ãããããç§ã«ãšã£ãŠã¯çã¿ãšèŠãã¿ã®å€ã ã£ãããã§ãã
ãã®ãããSafariãã¯ã©ãã·ã¥ããŸãã éçºè ããŒã«ã䜿çšããŠãããã°ããããšã¯ã§ããŸãããã¡ã¢ãªæ¶è²»ã«ã€ããŠã¯äœããããŸããã iOSã·ãã¥ã¬ãŒã¿ãŒã§ããŒãžãéãããšãé¡ã£ãŠããŸã-èœã¡ãŸããã ã¢ã¯ãã£ããã£ã¢ãã¿ãŒã§ç¢ºèªããŸãã-ãããããããã¡ã¢ãªã¯ããããã®ç»åã§æé·ããŠããã解æŸãããŠããŸããã ãŸããå°ãªããšãäœãã 圌ã¯å®éšãå§ããŸããã ã·ãã¥ã¬ãŒã¿ãŒã§ã®å®éšã®å 容ãç解ã§ããããã«ã1ã€ã®ç»åã§ã¡ã¢ãªãªãŒã¯ã確èªããããšã¯äžå¯èœã§ãã 4-5ã§ã¯é£ããã§ãã 20åãéžæããã®ãæåã§ããã·ãããã§ãã©ãã°ãŸãã¯éžæããããšã¯ã§ããªãããã20åã¯ãªãã¯ããå¿ èŠããããŸãã éžæããåŸãã¿ã¹ã¯ãããŒãžã£ãŒã調ã¹ãŠæšæž¬ããå¿ èŠããããŸããã¡ã¢ãªæ¶è²»éã50ã¡ã¬ãã€ãæžå°ããã®ã¯ã©ã³ãã ãªå€åã§ãããããŸãã¯ç§ãæ£ããããšãããŸããã
äžè¬çã«ãå€ãã®è©Šè¡é¯èª€ã®åŸãç§ã¯ã·ã³ãã«ã ãéåžžã«éèŠãªçµè«ã«éããŸããïŒããªãã¯ãã¹ãŠã解æŸããå¿ èŠããããŸãã å¯èœãªéãæ©æ¥ã«ãå©çšå¯èœãªæ段ã§ã ãããŠãã§ããã ãé ãå²ãåœãŠãŸãã ã¬ããŒãžã³ã¬ã¯ã·ã§ã³ã«å®å šã«äŸåããããšã¯ã§ããŸããã ãã£ã³ãã¹ãäœæããå ŽåãæåŸã«ãºãŒã ããå¿ èŠããããŸãïŒ1Ã1ãã¯ã»ã«ã«ããŸãïŒãç»åãæåŸã«ããå Žåã¯ã
src="about:blank"
å²ãåœãŠãŠã¢ã³ããŒãããå¿ èŠããããŸãã DOMããåé€ããã ãã§ã¯ååã§ã¯ãããŸããã
URL.createObjectURL
ã
URL.createObjectURL
ããŠãã¡ã€ã«ãéãå Žåã¯ã
URL.createObjectURL
ã䜿çšããŠããã«éããå¿ èŠããããŸãã
ã³ãŒãã匷åã«åŠçããåŸã512 MBã®ã¡ã¢ãªãæèŒããå€ãiPhoneã¯50æ以äžã®åçãæ¶åãå§ããŸããã Androidã®ChromeãšOperaã®åäœãå€§å¹ ã«æ¹åãããŸããããããŸã§ã«ãªã160æã®20ã¡ã¬ãã¯ã»ã«ã®åçãããã£ãããšã§ã¯ããããéåããããšãªããæäŸãããŸããã ã¡ã¢ãªæ¶è²»ãšãã¹ã¯ããããã©ãŠã¶ãŒãžã®åãæçãªå¹æ-IEãChromeãããã³Safariã¯ãåäœäžã«ã¿ãããšã«200ã¡ã¬ãã€ã以äžã§å®å®ããŠæ¶è²»ãå§ããŸããã æ®å¿µãªãããããã¯Firefoxã®å©ãã«ã¯ãªããŸããã§ãã-圌ã¯25æã®ãã¹ãç»åã®ã®ã¬ãã€ããé£ã¹ãã®ã§ã圌ã¯ç¶ããŸããã Androidã§ã®ã¢ãã€ã«FirefoxãšDolphinã«ã€ããŠã¯äœãèšããŸãããè€æ°ã®ãã¡ã€ã«ãéžæããããšã¯äžå¯èœã§ãã
ããŒã4.çµè«ã®ãããªãã®
ã芧ã®ãšãããã¯ã©ã€ã¢ã³ãã§åçã®ãµã€ãºãå€æŽããã®ã¯ãããããããèŠçã§ãã ãã©ã³ã±ã³ã·ã¥ã¿ã€ã³ã®äžçš®ã§ããããšãå€æããŸãããäžå¿«ãªãã€ãã£ãã®ãµã€ãºå€æŽã¯ãå°ãªããšãããçšåºŠã®å質ãåŸãããã«ç¹°ãè¿ã䜿çšãããŸãã ãããã£ãŠãããŸããŸãªãã©ãããã©ãŒã ã®æ€åºäžå¯èœãªå¶éããã€ãã¹ããå¿ èŠããããŸãã ãŸããåçãç³é¹žã£ãœããŸãã¯ã·ã£ãŒããããå Žåãå ã®ãµã€ãºãšæçµãµã€ãºã®ãã©ã€ããŒããªçµã¿åãããå€ããããŸãã
ãã©ãŠã¶ã¯çã£ããããªãªãœãŒã¹ãé£ãå°œãããäœã解æŸããããéæ³ã¯æ©èœããŸããã ãã®æå³ã§ã¯ããªãœãŒã¹ãæ瀺çã«è§£æŸããå¿ èŠãããã³ã³ãã€ã«æžã¿èšèªã§äœæ¥ããå Žåãããããã¹ãŠãæªåããŸãã jsã§ã¯ã第äžã«ãäœããªãªãŒã¹ããå¿ èŠãããããæããã§ã¯ãããŸããã第äºã«ãããã¯åžžã«å¯èœãšã¯ã»ã©é ãã§ãã ããã§ããå°ãªããšãã»ãšãã©ã®ãã©ãŠã¶ãŒã®é£æ¬²ãæããããšã¯éåžžã«çŸå®çã§ãã
èå°è£ã«ã¯EXIFãšã®ä»äºããããŸããã ã»ãšãã©ãã¹ãŠã®ã¹ããŒããã©ã³ãšã«ã¡ã©ã¯åãæ¹åã§ãããªãã¯ã¹ããç»åããã£ããã£ããå®éã®æ¹åã¯EXIFã«èšé²ãããããããã®æ å ±ããµã ãã€ã«ãšãšãã«ãµãŒããŒã«è»¢éããããšãéèŠã§ãã 幞ããªããšã«ãJPEG圢åŒã¯éåžžã«åçŽã§ãããç§ã®ãããžã§ã¯ãã§ã¯ã解æããããšãªãããœãŒã¹ãã¡ã€ã«ããæåŸã®ã»ã¯ã·ã§ã³ã«EXIFã»ã¯ã·ã§ã³ã転éããã ãã§ãã
UploadcareãŠã£ãžã§ããçšã®ãã¡ã€ã«ãã¢ããããŒãããåã«ããµã€ãºå€æŽãèšè¿°ããããã»ã¹ã§ãã®ãã¹ãŠãåŠã³ã枬å®ããŸããã ãã®èšäºã§åŒçšããã³ãŒãã¯ãç©èªã®ããžãã¯ãããå¿ å®ã«ãã©ã£ãŠããŸããããšã©ãŒåŠçãšãã©ãŠã¶ãŒã®ãµããŒããšããç¹ã§ã¯ãå€ããæ¬ èœããŠããŸãã ãããã£ãŠãèªåã§äœ¿çšãããå Žåã¯ããŠã£ãžã§ããã®ãœãŒã¹ã³ãŒãã確èªããããšããå§ãããŸã ã
ã¡ãªã¿ã«ãããã«ããã«ããã€ãã®æ°åããããŸãããã®ææ³ã䜿çšãããšãiPhone 5ãã80æã®åçã800Ã600ã®è§£å床ã«çž®å°ããã3Gçµç±ã§2å以å ã«ããŠã³ããŒããããŸãã åãå ã®åçã®èªã¿èŸŒã¿ã«ã¯26åãããå ŽåããããŸãã ã ããããã¯äŸ¡å€ããã£ãã