DATA URI格式有哪些重要部分?

时间:2012-03-09 16:07:11

标签: image uri base64 data-uri

红点的数据URI:

<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' height='32' width='32' alt='Image'>

如果有的话,这里的部分是什么?例如,是为该类型保留的前20个字符,下一个是不透明度的2个字符等?如果有人能指出我在正确的地方,我在intergoogles上找不到任何东西!

确定PNG在字符串中有相似之处: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAh7sky7OeYKB8+tP6XGdtx//a/E2m63tavY/hRM=qW+lVt1OD8sxrieE5j7ebvK3eiz+1==eV=Crr4=

iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPAi4CAAAAB3RJTUUH1QEHDxEhOnxCRgAAAAlwSFlzAAAK8AAACvABQqw0mAAAAXBJREFUeNrtV0FywzAIxJ3+K/pZyctKXqamji0htEik9qEHc3JkWC2LRPCS6Zh9HIy/AP4FwKf75iHEr6eU6Mt1WzIOFjFL7IFkYBx3zWBVkkeXAUCXwl1tvz2qdBLfJrzK7ixNUmVdTIAB8PMtxHgAsFNNkoExRKA+HocriOQAiC+1kShhACwSRGAEwPP96zYIoE8Pmph9qEWWKcCWRAfA/mkfJ0F6dSoA8KW3CRhn3ZHcW2is9VOsAgoqHblncAsyaCgcbqpUZQnWoGTcp/AnuwCoOUjhIvCvN59UBeoPZ/AYyLm3cWVAjxhpqREVaP0974iVwH51d4AVNaSC8TRNNYDQEFdlzDW9ob10YlvGQm0mQ+elSpcCCBtDgQD7cDFojdx7NIeHJkqi96cOGNkfZOroZsHtlPYoR7TOp3Vmfa5+49uoSSRyjfvc0A1kLx4KC6sNSeDieD1AWhrJLe0y+uy7b9GjP83l+m68AJ72AwSRPN5g7uwUAAAAAElFTkSuQmCC

前20-30个类似于小变量: iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPA

但我无法确定任何格式/模式。使用=/我会查看RFC,但这仍然是开放的......

1 个答案:

答案 0 :(得分:2)

 data:          Required, data-URI protocol
 image/png      Required, MIME-type
 ;charset=UTF8  Optional, character encoding
 ;base64        Optional
 ,              Required
 ...            Optional:
                Note: When ;base64 is set, a valid base64 string has to be given

另见: