Firefox中没有加载Base64图像

时间:2013-12-04 07:19:52

标签: html css image firefox base64

我有base64转换后的图像,并像这样放置容器背景:

background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADsAAAAuCAYAAACWPmGbAAAGL0lEQVRo3tWaC2wUVRSGp7a1yqtAWuiCivKIAUWUKgGJGB5FBZUYrRaV1qgFi9gKigg+EBSBqAgoIij1AfhAxSqKyhJTRQtG1Bqtb4wvCsGmUkSklIr/2fzXXG9mutOZ2e12k4+27M6999w595z/nFnLSsBXKCurK7gYzAUvgg/Br6AWHARHwF5QA6rA22AlmAwGgVQrkV9YYCcwHXwG/qFBXvkTvABGJZqRKWAW2O/TQCc+BgMSwdBk8GaMjNQR1z+/pY29LA6GKna0tLET42jsHy1tbEfwY5yMvT0Rzu1xYFMMjfwLFCWCoRmgDUhiXpV82RCQkTvBA6A75zqhOQvLBH1ANhjMn/1BD3C0R2NvpIGdjXybBxaDD8DvLgyrBz+Al8FMCoskbUzZyGqnRZwOpoHnwdfgQJTJRARUg3Lu5qWgvQtjx/B6ubYYtHP43LGgFzd4CBihbXZIN8zGjnVc3+emS90NfgrIjWS3XwMjoxj8uHbNfm7wNaCnB0+RTTkHzAaV2rgiK7PVhwrBvhgGibdAtyYWmeewyXVgG3gJLAH3gxnkLrAAPAU2gu9Bo3F9I7V1SE00NU6hX85UehTZmAvWU9v6mUuO3jzdOyKu7jIABMVEw0A52wUOhg8E1/PurQVbwHbwjaghFgzy9xtgueRRBqIsm/E6gDUWL4yXsVcYiyhk8JDyrGuM0ttYCpca9Ud9HAwV4ZBsLCSdZ+0II/7TItgl0Pg0UNLhzbz7av6p6s0zwKcxVDASHVMcFhZiADOrlPfBw2ASuJBu3RMcz8whv5/M6JtHN15r46kSeAvVZOPUAQbnMXrVBWDkJ6xTMzh+b9CvibsxCmwI0Mt+BnNAF30S2fmFugqS38FQUAJKwbt0t1pjMdIa2c0C+VUwn2Vbd8OQwUwtJTZ3ta1NMJExHqRIqXbRuZAj8BVz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OtlrLi+KkzKOh27w+1G5Jg9uwz9wcQ7cG3SWJp8GpFN/RHj1KO+ihmCX/OBudxe8jlmtlWh2lqNSxPeK5nn8BPgwi0dd0GXEAAAAASUVORK5CIIA=');
除了Mozilla Firefox之外,Chrome和其他浏览器都可以毫无问题地打开它。它显示我的空白图像,当我尝试手动打开图像时,它给了我错误:

  

图片:“ data:image / png; base64,iV ... 5CIIA = ”无法显示   因为它包含错误

为什么会发生这种情况以及如何解决?

这是尝试的小提琴:http://jsfiddle.net/zur4ik/QUXV5/

1 个答案:

答案 0 :(得分:5)

看起来实际的base64数据有问题。根据{{​​1}}文件查看类似的working example

尝试将这些工具用于encodedecode您的文件。