Base64 / SVG HTML 图像不显示

Posted

技术标签:

【中文标题】Base64 / SVG HTML 图像不显示【英文标题】:Base64 / SVG HTML image is not displayed 【发布时间】:2014-08-11 19:14:50 【问题描述】:

我尝试使用这个图标

<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI2cHgiIGhlaWdodD0iMTI2cHgiIHZpZXdCb3g9IjAgMCAxMjYgMTI2IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMjYgMTI2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxyZWN0IHg9IjEuMDk1IiB5PSI5OC4yMjQiIHdpZHRoPSIxMjMuODEiIGhlaWdodD0iMTkuMjc1Ii8+DQoJPHJlY3QgeD0iMS4wOTUiIHk9Ijg1Ljc0IiB3aWR0aD0iMTIzLjgxIiBoZWlnaHQ9IjUuMjA1Ii8+DQoJPHBhdGggZD0iTTE4LjQwNCw5NS43MjFjMC43NjcsMCwxLjM4OS0wLjYyMywxLjM4OS0xLjM5cy0wLjYyMi0xLjM4OC0xLjM4OS0xLjM4OEgzLjQ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-icon/baggage-on-conveyor-band_48876

我只是将 html 代码 (Base64 / svg) 复制并粘贴到我的网站中。 但图标不显示。为什么?

这是一个例子 http://jsfiddle.net/Lsr4s/

更新: 我不明白。我复制了另一个图像/图标,它也坏了,但是 base64 代码没有“=” jsfiddle.net/TYb59 flatIcon.com 页面是否有问题?

我可以修复这些图像/图标吗?

【问题讨论】:

我建议自己下载图片上传并放在链接中。i.imgur.com/fqAsZoj.png">我为你做的 jsfiddle.net/fKt8G 【参考方案1】:

我建议下载图像。自己上传并附上链接。 看看我上面的评论。不让我发布 jsfiddle..

【讨论】:

...在测量数十万移动网页浏览量的性能时,使用数据 URI 加载图像的速度平均比使用二进制源链接(例如带有 src 的 img 标签)慢 6 倍属性! 这是真的!毫无疑问【参考方案2】:

您复制的 base64 代码已损坏。接近尾声的代码中间有==。这是一个放在 base64 代码末尾的填充符。

==后面的部分去掉,就可以正常使用了。

<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI2cHgiIGhlaWdodD0iMTI2cHgiIHZpZXdCb3g9IjAgMCAxMjYgMTI2IiBlbmF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OWgtMTQuNTI0VjkuOTYxDQoJCWMwLTAuODA3LTAuNjUzLTEuNDYtMS40Ni0xLjQ2aC0xOWMtMC44MDcsMC0xLjQ2LDAuNjUzLTEuNDYsMS40NnY2LjExNUg2OC43MzRjLTAuODA3LDAtMS40NiwwLjY1My0xLjQ2LDEuNDU5Vjc5LjQ0DQoJCUM2Ny4yNzQsODAuMjQ3LDY3LjkyNyw4MC45LDY4LjczNCw4MC45eiBNODYuNjM4LDEyLjg5aDEzLjEzOXYzLjE4Nkg4Ni42MzhWMTIuODl6Ii8+DQo8L2c+DQo8L3N2Zz4NCg=="/>

演示:http://jsfiddle.net/Lsr4s/2/

编辑:

从站点下载 svg 文件并使用 base64 编码得到完全相同的结果。如果没有可以用来轻松修复代码的签名,那就是您需要做的。

我使用这样的 C# 代码将图像 base64 编码为文本文件:

File.WriteAllText(@"d:\temp\baggage19.txt", Convert.ToBase64String(File.ReadAllBytes(@"d:\temp\baggage19.svg")));

【讨论】:

我不明白。我复制了另一张图片,但它也坏了……但是 base64 代码没有“=”jsfiddle.net/TYb59 flatIcon.com 页面是否有问题? @Peter:也许是这样。如果字节数不能被三整除,base64 代码的末尾只有===。没有它,就没有简单的方法来判断代码是否被截断或附加了垃圾。如果您给我该页面的链接,我可以获取 svg 文件并对其进行 base64 编码以查看它应该是什么。 下载为 SVG 文件并编码为 base64。作品!谢谢! 您可以使用具有像 iconrequest.com 这样的 CDN 的图标提供程序 注意:base64 代码在svg 部分之后包含+xml 很重要。【参考方案3】:

所以,在尝试了一些事情之后(我真的需要将 SVG 显示为 src="data:")。我遇到了几个关键点:

您不必将其编码为 base64,可以使用纯 svg,这使其更具可读性,并且长度和 gzip 之后都更小。测试/调试/编辑也更容易。 无论您使用 base64 还是 utf8,在 svg 标记中都有 xmlns 属性是必要的。那是我最难忘的部分。

现在不用多说,举个简单的例子:

<img src="data:image/svg+xml;utf8, <svg xmlns='http://www.w3.org/2000/svg'><line x1='0' y1='0' x2='200' y2='200' style='stroke:rgb(255,0,0);stroke-width:2'/></svg>" />

为了完整性:http://jsfiddle.net/y1akw1fd/

【讨论】:

你好@mateuscb,根据你上面的解决方案,我需要你详细的帮助我想在svg中添加图像元素,这就是我想要的:w3.org/2000/svg'><imageoverflow='visible' enable-background='new' width='50' height='50' xlink:href='mdn.mozillademos.org/files/6457/…x1='0' y1=' 0' x2='200' y2='200' style='stroke:rgb(255,0,0);stroke-width:2' />" /> 请帮忙谢谢 @mateuscb 最兼容的答案【参考方案4】:

没有显示,根据https://www.base64decode.org/你的base64包含错误

最后你添加==5324e483b5f25ab4badb7c52c102103e - 数据不正确!

所以我建议您使用一些工具将图像数据正确转换为 base64 字符串。就像https://www.base64encode.org/ 一样,一切都会好起来的!

【讨论】:

【参考方案5】:

我今天遇到了类似的问题,得出以下结论:

&lt;embed&gt; 描述的 &lt;embed&gt; 标签的使用与测试的浏览器(Firefox、Safari、Mac OS 上的 Chrome)具有最佳兼容性。上面的代码可以写成:

<embed src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTI2cHgiIGhlaWdodD0iMTI2cHgiIHZpZXd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YtMC42NTMtMS40NTktMS40Ni0xLjQ1OWgtMTQuNTI0VjkuOTYxDQoJCWMwLTAuODA3LTAuNjUzLTEuNDYtMS40Ni0xLjQ2aC0xOWMtMC44MDcsMC0xLjQ2LDAuNjUzLTEuNDYsMS40NnY2LjExNUg2OC43MzRjLTAuODA3LDAtMS40NiwwLjY1My0xLjQ2LDEuNDU5Vjc5LjQ0DQoJCUM2Ny4yNzQsODAuMjQ3LDY3LjkyNyw4MC45LDY4LjczNCw4MC45eiBNODYuNjM4LDEyLjg5aDEzLjEzOXYzLjE4Nkg4Ni42MzhWMTIuODl6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==5324e483b5f25ab4badb7c52c102103e"/>

【讨论】:

以上是关于Base64 / SVG HTML 图像不显示的主要内容,如果未能解决你的问题,请参考以下文章

用 Java 编码的 Base64 图像不显示在 HTML 中

在节点中将 svg 图像从 url 转换为 base64

在节点中将 svg 图像从 url 转换为 base64

用作 base-64 背景图像数据时如何更改 svg 填充颜色?

从SASS编译时CSS背景网址SVG填充颜色不起作用(不是base64)[重复]

使用 angularjs 将 svg 中的 xlink:href 设置为 base64 编码的图像