图片转data:URI工具

昨晚由于需要用data:uri,于是做了这么个转换工具
可本地使用,因为文件不用上传
疯狂的点击这里看demo
截图[此截图使用datauri,看不见请升级人品]

上面这张图的datauri

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/QAAAJBCAIAAABnN2lHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACSDSURBVHhe7dpdcms5sh7QGq0n5/CTp+E59YWYWzgQ/jZIUX1K6bWCoUhkfgBZ9VLp9v3nf/2//wAAAAlY7gEAIAnLPQAAJPGx3Pv8rQ8AALyR5f5vfgAA4I0s93/zAwAAb2S5/5sfAAB4I8v93/wAAMAbWe7/5gcAAN7Icv83PwAA8Eb3y/0///y3/x8A+2/spt/8ebfXf/QfHwAA3uh+c22321KP9tNRzddbt532001X4dJf6WKbY3ymzfh8PLfV5bsPAAC80c32WT7thlrrsejq8RifsXnSaT/jt4zaQGS6Tv2chM+v74/jBwAA3uhm+yyfdkOt9Vh09XiMz9g86bSfdrpPxmeaqc1xGp3yd2UMHx7HDwAAvNFy+/xYY7+KZp12xVh3xsx5p3w+nhi001q3n1Wm1quL42eaLM29Lt99AADgje5X23ZDrfVYdM1pv6trZ2/Mj/UYK5/N3f3F+HSjaXKf2TweHwAAeKOb7bN82g211mNR627UBsbjtLP/tPlaR1H+tp2Vmu+KKjrdtDbbT9ffH8cPAAC80c32WT6xoda/oy7Zfl7r7D+R7/6G2uk+bbOLjfmu0+W7T+nvdfnuAwAAb3SzfZZPu6SO22rb6eo41qL2a73q7D+P9/68XERdp1G0n7G5yZ90Vp/zZHwAAOCNbpbRsq22C+t+eY1weG3U6mLx6Ua1Hov2MzY3+a4TxzE2/RzG6gcAAN5ouYyWPTVW1XZhbevx000/7g/5k075TGPRbEe1fgwn01EddUX9tJ1VXT+ludfluw8AALzRzfZZPu2Gut9Wp9OuOWZObrWfdlTrKFa3xn53sf2cjFaf20D3AQCAN7pfRtuFdbq81maXbI/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cg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQhOUeAACSsNwDAEASlnsAAEjCcg8AAElY7gEAIAnLPQAAJGG5BwCAJCz3AACQRL/G/+c//wNAn/5fp2D0CgAAAABJRU5ErkJggg==

datauri优点:
在页面添加图片不用额外上传文件了!
还有什么就不知到了
缺点:
无法缓存,每次加载页面都要载入(其实想缓存它只要用js文件复制给变量就行了,而且可以一个文件存N张图,和图片分割异曲同工啊)
浏览器支持不全面
转出来的字符串体积一般比原文件大= =。。。

demo源码[部分参考其他网站]

把图片拖到这里

[其实我发现除了图片以外还可以拖其它任何文件进来,只不过下面的预览图会裂掉另外最好不要把超过1MB的文件拉进来,不然你懂的]

PS:如果同时拖入多个文件,只操作第一个,拖入文件夹无效



本文发布于 https://luojia.me

本站文章未经文下加注授权不得拷贝发布。

本博客使用Disqus评论系统,如果看不到评论框,请尝试爬墙。