safari:与image / jpeg和img / jpg的区别

时间:2016-03-11 04:56:33

标签: html safari uri mime-types

我在网络开发中遇到了一个有趣的错误。 在我们在Mac OS上的Safari上检查我们的网站之前,浏览器中的一切似乎都很好。

<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCACHALQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDfooooAKKKKAK1+AbUg46jrWVxgZIOOOe1amoHFqTkjB6iskScZOMe9d+G+A5K7XNqOypAUnIzjgduv9KcX2hh+p/lTNxZ1Uc8UjHnJZq2a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UOQex7j0oopOTLSuIFPTAGOopArswwnXOBmiincGhvJOR1HP6d6dtfGdoxnpRRQ3YVhojc/NyQecZHY0LExOAuV789faiihyYWDy5CBtGc8cH34pu3K5A+Xjv8AeoopJsdhwjdTu25bPOTQu8r8vCnjOaKKLisDK4YKBuZsjPfNOxKDhh17etFFTzFcqsLtO0EJgZC9aCj4JCjp/n+dFFCYSikIUZMlhg9DjpmjY4ILjgnA/lRRTuKwbJSc9R14P5UBWJyARx+VFFJsErj0UswyvXjrTvvD5U46HmiiobszRLQY0bA4Lqv1zRRRTuZ2P//Z" thumbnail="ab06b0f4f155495a92e5e97f02270116">

我得到了那个图像标签,它将图像显示为数据uri,带有mimetype of image / jpg。

我对这个mimetype感到困惑,为什么Chrome,IE和Firefox会显示我的图像,但是在我们将图像更改为图像/ jpeg之前,它不会在Safari上加载图像。

有谁知道为什么这么特别?如果您可以提供参考链接,也会有所帮助。

1 个答案:

答案 0 :(得分:1)

image / jpg在技术上是无效的,尽管它在很多情况下都支持MIME类型。你应该总是使用image / jpeg。这有点令人困惑,因为.jpg是一个有效的扩展名。