2012-03-09 31 views
0

數據URI的紅點:數據URI格式是否有重要的部分?

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

如果任何這裏的部分?例如,該類型的前20個字符是否保留,後面的2個是否爲不透明等?如果任何人都可以指引我到正確的地方,我無法找到互聯網上的任何東西!

確定爲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類似輕微variancies: iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAAAAACPA

但我無法確定任何格式/模式。使用=/我會看RFC,但是這仍然是開放的......

回答

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 

參見:

+0

我發現維基百科,生病看第二次感謝! – roberthuttinger 2012-03-09 16:13:12

+0

我找不到實際的格式或類似的東西。我更新了這個問題 – roberthuttinger 2012-03-09 17:24:31

+1

@roberthuttinger你的問題與base 64沒有任何關係,因爲沒有任何魔法:[JS base64 enc implementation](http://stackoverflow.com/a/246813))。頭的含義取決於文件類型。例如,查看[PNG的標題](http://en.wikipedia.org/wiki/Portable_Network_Graphics#Technical_details)。 – 2012-03-09 17:36:06

相關問題