IE认为jpeg是bmp

发布于 2024-10-18 08:37:04 字数 1037 浏览 4 评论 0原文

我有一个图像缩略图功能,基本上只是重新调整图像大小并通过 GD 输出它

在所有浏览器上都显示良好,除了 IE 中它认为它是一个 bmp 文件...这通常很好,除非我试图使用 jquery 拖动它,每次拖动文件时,文件需要大约 10 秒才能渲染...不知道为什么...

当我尝试保存图像文件时,它将默认为 Untitled.bmp 并且不允许我更改文件类型。

我什至尝试通过从缓存复制来直接加载图像文件,并且它工作正常,因此文件本身没问题......但我只是无法让 symfony 以“喜欢”的方式输出图像。 ..

到目前为止我尝试过的事情:

  • Content-Type:image/jpeg
  • Content-Type:image/pjpeg
  • Content-Type:application/download + Content-Disposition:attachment;filename =“test.jpg”
  • Content-Type:image/ jpeg + 内容处置:附件;文件名=“test.jpg”
  • 内容类型:image/jpeg + 内容处置:内联:文件名=“test.jpg”
  • 内容类型:应用程序/下载 + 内容处置:内联; filename =“test.jpg”

我已将 Content-Length 添加到上述所有内容中,并且它在 firebug 的网络面板上运行良好...但是 ie 的开发人员工具>图像报告显示文件大小为 -1 字节。

我唯一能想到的是图像的网址:

http://www.example.com/imagePreview?component[0][id]=1&component[0][option_id]=5& ;component[1][id]=2&component[1][option_id]=4&width=400

我尝试在最后添加一个.jpg,但它仍然拒绝以 jpeg 形式读取文件...

所以是的,我需要你们的一些想法和帮助

I have a image thumbnail function that basically just re-sizes the image and outputs it via GD

It shows fine on all browsers, except in IE where it thinks it's a bmp file... which is fine usually except when I'm trying to use jquery to drag it and the file takes ~10s to render everytime I drag it... not sure why...

When I try to save the image file, it will default to Untitled.bmp and not let me change the file type.

I even tried to load the image file directly by copying it from the cache, and it works fine, so the file itself is ok... but I just can't get symfony to output the image in a way ie 'likes'...

things I have tried so far:

  • Content-Type: image/jpeg
  • Content-Type: image/pjpeg
  • Content-Type: application/download + Content-Disposition: attachment;filename="test.jpg"
  • Content-Type: image/jpeg + Content-Disposition: attachment;filename="test.jpg"
  • Content-Type: image/jpeg + Content-Disposition: inline:filename="test.jpg"
  • Content-Type: application/download + Content-Disposition: inline;filename="test.jpg"

I have added Content-Length to all of the above and it goes fine through on firebug's net panel... but ie's developer tools > image report says the filesize is -1 bytes.

The only thing left that I can think of is the url of the image:

http://www.example.com/imagePreview?component[0][id]=1&component[0][option_id]=5&component[1][id]=2&component[1][option_id]=4&width=400

I tried to add a .jpg at the end, but it still refuses to read the file as a jpeg...

So yea, I need some ideas and help from you guys

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不吻晚风 2024-10-25 08:37:04

请记住,IE 缓存就是: 缓存。如果图像不在缓存中 ,IE 拥有的唯一表示形式是 GDI 使用的内存表示形式,即 BMP。

Please remember that the IE cache is just that: a cache. If an image isn't in the cache, the only representation IE has is the in-memory representation that GDI uses, which is a BMP.

七婞 2024-10-25 08:37:04

首先,删除 Internet 临时文件。旧的 IE 版本有一个恼人的错误:当缓存已满时,图像会保存为 BMP。

First of all, remove the Temporary Internet Files. Old IE versions had an annoying bug: when cache got full, images were saved as BMP.

孤芳又自赏 2024-10-25 08:37:04

好吧,我解决了拖动图像时出现的延迟问题:

将不透明度动画设置为 100% 后,即使动画完成后,alpha 滤镜仍然保留在那里,即使滤镜完全不执行任何操作,但它仍然需要处理,这就是导致巨大延迟的原因。

拖动滞后的解决方法:
- 动画取消设置CSS不透明度后:$(this).css('opacity', '')

至于jpeg被解释为bmp,我想这不是拖动滞后的原因,并且在一天结束时没关系<_<

Well I fixed the laggy issue with dragging the image:

After animating opacity to 100%, the alpha filter remains there even after the animation has finished, even though the filter does absolutely nothing it still has to process which was what was causing the huge lag.

Solution to drag lag:
- After animation unset css opacity: $(this).css('opacity', '')

As for the jpeg being interpretted as bmp, I guess it wasn't the cause of the drag lag, and at the end of the day it doesn't matter <_<

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文