简体   繁体   English

Internet Explorer和Base64图像显示

[英]Internet Explorer and Base64 image display

In aim to manipulate more easily various images on client side with Javascript, I wrote a function on server side (in VB 2010) to convert a file into a base64 string that I send to the client. 为了使用Javascript更容易地在客户端操作各种图像,我在服务器端(在VB 2010中)编写了一个函数,将文件转换为我发送给客户端的base64字符串。

When I tried it in Internet Explorer 8.0 with 3 different images, 1 portrait and 2 landscapes, I realized that only the portrait image was displayed entirely, meanwhile both landscape images were truncated (I can see just the upper part of the image). 当我在Internet Explorer 8.0中尝试3个不同的图像,1个肖像和2个风景时,我意识到只有肖像图像被完全显示,同时两个风景图像都被截断了(我只能看到图像的上半部分)。

I thought I had a bug in my conversion function, until I tried my local page with Firefox: every image is perfectly displayed by Firefox. 我以为我的转换功能有一个错误,直到我用Firefox尝试我的本地页面:每个图像都由Firefox完美显示。

So there is my question: Is this a well-known bug of Internet Explorer ? 所以我的问题是:这是一个众所周知的Internet Explorer漏洞吗? If the answer is yes, Is there a well-known remedy for that well-known bug? 如果答案是肯定的,对于那个众所周知的bug有没有一个众所周知的补救措施?

IE8 can only do Base64 URI images up to 32kb in size. IE8只能执行最大32kb的Base64 URI映像。 It's a marginally annoying limitation, but you can still get by with icons/etc. 这是一个令人讨厌的限制,但你仍然可以使用图标/等。 Keep in mind that Base64 encoded images are on average 33% more data sent down the pipe anyway, so it's... eh, y'know, use your judgement. 请记住,无论如何,Base64编码的图像在管道上发送的数据平均多33%,所以它......呃,你知道,用你的判断。

For anyone interested, it's also possible to make these work in IE6/7 (without, I might add, that 32kb limit...): http://venodesigns.net/2010/06/17/you-got-your-base64-in-my-css/ 对于任何感兴趣的人,也可以在IE6 / 7中进行这些工作(没有,我可以补充说,32kb限制...): http//venodesigns.net/2010/06/17/you-got-your-基于64位的,我的,CSS /

IE8 is limited to 32KB. IE8限制为32KB。 One way around this is to just serve the images in 'tiles' where each tile is less than 32KB. 解决此问题的一种方法是仅在“瓷砖”中提供图像,其中每个瓷砖小于32KB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM