注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

米欧互联

No matter what you want to express……

 
 
 

日志

 
 
关于我

{ note: ‘不会编程的设计狮不是好科研狗’ }

网易考拉推荐

DATA URI和BASE64图片:图片转文本(data:image/png;base64)  

2013-08-04 23:13:01|  分类: html |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Data URI是由RFC 2397定义的一种把小文件直接嵌入文档的方案。通过如下语法就可以把小文件变成指定编码直接嵌入到页面中。
运行如下代码会看到一条蓝色渐变底色的标题:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<head>
<style type="text/css">
.title {
background-image:url(data:image/gif;base64,R0lGODlhAQAcALMAAMXh96HR97XZ98Hf98Xg97DX97nb98Lf97vc98Tg973d96rU97ba97%2Fe96XS9wAAACH5BAAAAAAALAAAAAABABwAAAQVMLhVBDNItXESAURyDI2CGIxQLE4EADs%3D);
background-repeat:repeat-x;
height:28px;
line-height: 28px;
text-align:center;
}
</style>
</head>
<body>
<div class="title">Hello, world!</div>
</body>
</html>


1、DATA URI
优点:减少HTTP请求的数量,把资源直接镶嵌在页面中。
缺点:使得页面内容变大。

既然是Url,当然也可以直接在浏览器的地址栏中输入。
data:text/html,<html><body><p><b>Hello, world!</b></p></body></html>
在浏览器中输入以上的Url,会得到一个加粗的"Hello, world!"。
也就是说,data:后面的数据直接用做网页的内容,而不是网页的地址。

简单的说,data类型的Url大致有下面几种形式。


data:,<文本数据>
data:text/plain,<文本数据>
data:text/html,<HTML代码>
data:text/html;base64,<base64编码的HTML代码>
data:text/css,<CSS代码>
data:text/css;base64,<base64编码的CSS代码>
data:text/javascript,<Javascript代码>
data:text/javascript;base64,<base64编码的Javascript代码>
data:image/gif;base64,base64编码的gif图片数据
data:image/png;base64,base64编码的png图片数据
data:image/jpeg;base64,base64编码的jpeg图片数据
data:image/x-icon;base64,base64编码的icon图片数据


data:,【文本数据】
data:text/plain,【文本数据】
data:text/css,【CSS代码】
data:text/css;base64,【base64编码的CSS代码】
data:text/javascript,【Javascript代码】
data:text/javascript;base64,【base64编码的Javascript代码】
data:image/gif;base64,【base64编码的gif图片数据】
data:image/png;base64,【base64编码的png图片数据】
data:image/jpeg;base64,【base64编码的jpeg图片数据】
data:image/x-icon;base64,【base64编码的icon图片数据】

data格式Url的种种应用举例
可以在Html的Img对象中使用,例如
<img src="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAF..." />

可以在Css的background-image属性中使用,例如
div.image {
width:100px;
height:100px;
background-image:url(data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAF...);
}

可以在Html的Css链接处使用,例如
<link rel="stylesheet" type="text/css" href="data:text/css;base64,LyogKioqKiogVGVtcGxhdGUgKioq..." />

可以在Html的Javascript链接处使用,例如
<script type="text/javascript" href="data:text/javascript;base64,dmFyIHNjT2JqMSA9IG5ldyBzY3Jv..."></script>


2、最常用的就是BASE64图片
e64,base64编码的icon图片数据
因为Url是一种基于文本的协议,所以gif/png/jpeg这种二进制属于需要用base64进行编码。换句话说,引入base64以后,就可以支持任意形式的数据格式。下面是个png图片的例子,会在浏览器中显示一个Mozilla的图标。

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==

2.1、用于img标签
img src="data:image/gif;base64,【gif图片base64编码数据】"
img src="data:image/png;base64,【png图片base64编码数据】"
img src="data:image/jpg;base64,【jpg图片base64编码数据】"
......
2.2、背景图片background-image
background-image:url(data:image/gif;base64,【gif图片base64编码数据】)
background-image:url(data:image/png;base64,【png图片base64编码数据】)
background-image:url(data:image/jpg;base64,【jpg图片base64编码数据】)
......

3、PHP操作base64
base64_encode($str);//对$str进行base64编码
base64_decode($str);//base64编码的$str还原


4、完整的语法定义
在RFC中,完整的语法定义如下。
dataurl := "data:" [ mediatype ] [ ";base64" ] "," data
mediatype := [ type "/" subtype ] *( ";" parameter )
data := *urlchar
parameter := attribute "=" value
urlchar指的就是一般url中允许的字符,有些字符需要转义,例如"="要转义为"%3D",不过我测试下来,至少在Firefox里面,不转义也是可以的。

parameter可以对mediatype进行属性的扩展,常见的是charset,用来定义编码格式,在多语言情况下需要用到。例如下面的例子。

data:text/plain;charset=UTF-8;base64,5L2g5aW977yM5Lit5paH77yB

这个例子会显示出"你好,中文!"。如果吧charset部分去掉,就会显示乱码,因为我用的是UTF-8编码。

Firefox有一个data类型Url的测试页面,列出了各种格式的data类型Url的测试Url,和测试结果说明。


5. base64编码和内容的隐秘
把二进制数据转换成为Base64不是什么难事,比如Total Commander就有这样的功能。还有一些在线资源,

有些在线转换把base64里面的“=”转换成为%3D,这个在Url中和“=”是一样的,不转换也没什么问题。

当然,这种Url还有一种隐秘的好处,就是将一些道貌岸然者不喜欢的东西,堂而皇之的放在页面上,例如下面这个数据图像。你可以Copy下来贴到地址栏里面去瞅瞅,呵呵呵:o)

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAABTCAYAAADnR+s9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAClVSURBVHjatH1bry1JctYXEZlZtdbe+5yevniY8W3AeMbYyAZbIDBXS8YYg0AgzFUCXuGJByTeeEOCZ175A/wIHkEIhAQSSBYGBIMN0+6Z7nPZe69VlRkRPERmVa1zBrABr9bW6d5nrVVVmXH54osvsuk//OO/662tIHIYAUQEeAIZQABUG+JFgDmIAFUFEcPdodqgaiASSEowMyx1hVCCCKHWCiKCSAbAMHcQEcwMAFBN0VoDiMHMEAeIAGYGENeqphARpJTiTojiPtXg7iA0AHE/RB7vYQczg4iQUur3qiCi/r7+HQCcHFkSAINDwcxwIxDHzRDHd/JYif65WCEguRpgDmeCEOBEgCkcBBYBgePvHVA3MBEMQOoLQUTIOcMMMFU0VTAIIgJVhaqilLlfmOLzfQHdHejvXWuLxY1d2h5UJDYmnicWABSPQ0nA5nAYrHn/ewCwm+uMDbnZAIp7ie8b9+LbUhEAU4DEoWYQImj/vvgOhvv4/iQQETAI7gQyAcAgB8YCcxJwYsRlCMQMR/8hij/dtwuICMwM7oRSzmDJYE7bewCAhxW4w8wgKSyRmaFwNDdABM5hCdtniQFhsEhYDPeF4LA4IoLB0dRh3i1pXEsNqgrz+D7vCzy+m4ngZtBqN/cCcHzOHKYKVwds/0lmYcJmgEMAGAjoqxwrrVVBJIA7qC+UW1xYKEHNQJxg1raFNHMQMZoqBABxgjYDp3Ax6g9AbkgUN6uq0P55Zt4s/Xq9wo1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HGsiw4ne/pxcuPvJwfkKcCmROuUPjDS//aT/7eP/mbsYgff/QRnh6f/TTfUWvmkoK9Gf1zwPw4OORQ2hMq7zPS3XjcsCthj9NUh5ZwYqEOqH0TXBP3sVvapvO245AH+D6eOz1ISukHpLEkrPUS8g4p5MkplxnNJ7TTB/SjP/PzfxC/Sa/HN58DwiQM3CUhEFO4M0NEiMjpGPt809YIjoJYkO9PNw40Ph4HO+a3IylFqQMwnKyf3Csg7uIe9vea1TeAkxnFiydsshMCiQuDluWCPAum0wmVMrV0z1//mT/14/hNfP37X/qP/MEHH1CrCxF7nFwXKIL6/foR+8L5u6oaNi+k2/9VwBh3k/6/KxEG/ucAMDpohUj/J1QAAAAASUVORK5CYII=










参考:
2.浏览器中的data类型的Url格式,data:image/png,data:image/jpeg!:
3.国产小软件 Image2DataURI 图像转Base64编码 http://www.uzzf.com/soft/11720.html
  评论这张
 
阅读(7719)| 评论(7)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017