为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Cannot open large PNG

  • 10 个回答
  • 4 人有此问题
  • 1 次查看
  • 最后回复者为 throwcode

more options

Firefox is unable to open large PNG. Tried opening the same PNG in other browsers (IE/Chrome) without any issues. The PNG is being served via webserver.

The initial error message was unable to open the image. I reset and restarted firefox in safe mode and now I see broken image.

I can upload an example image, if needed.

Firefox is unable to open large PNG. Tried opening the same PNG in other browsers (IE/Chrome) without any issues. The PNG is being served via webserver. The initial error message was unable to open the image. I reset and restarted firefox in safe mode and now I see broken image. I can upload an example image, if needed.

被采纳的解决方案

Is this PNG image large in file size or in the dimensions (height and width) as well?

A very large width (> 32000px) can cause problems.

定位到答案原位置 👍 1

所有回复 (10)

more options

Please post a link to the image.

more options

If the image is very long, this is a known problem in Firefox. The most the program can handle with hardware acceleration disabled is a height or width up to 32,766 pixels. You can get more of the painful details in this thread: "This image cannot be displayed because it contains errors".

more options

选择的解决方案

Is this PNG image large in file size or in the dimensions (height and width) as well?

A very large width (> 32000px) can cause problems.

more options

Got it - The Image is 900x40000 pixels. That explains it. I can limit it to 30000 or less and will do so. Thanks.

more options

This image cannot be displayed because it contains errors

It's annoying to read this line when i choose larger than 4 MP option on google image search result. I use download manager to download those images.

more options

This image cannot be displayed because it contains errors

That is a placeholder text that Firefox displays while downloading the image and this message should disappear once the download has finished and the image gets rendered.
If there is an error with the image or the image can't be displayed for other reasons then this text stays.
You can try to download and save the image and see if you can open it in another image viewing program if Firefox isn't able to view this image.

more options

I have a similar problem to Ferg above, ie, I have a large PNG file that the Browser developer tool Network tab shows loaded but Firefox will not present! I find the "solution" presented to Ferg less than satisfying.

"Chosen solution Is this PNG image large in file size or in the dimensions (height and width) as well? A very large width (> 32000px) can cause problems. "

This sounds like an explanation not a solution. Every other major browser handles my png Sprite 140 x 75300 with no problems (IE11,Opera,Google Chrome, Safari).

The painful solution to this is to chop the Sprite into three components and substitute logic just to make it work in Firefox.

Maybe I will just tell people who visit the site not to use Firefox.

Come on guys, are these restrictions as arbitrary and contrived as they appear. I would like to hear an explanation. Really.

Thanks, TC

more options

Hi TC, 32766 pixels results from a programming decision made long ago, which is using a "small integer" instead of an "integer" (or word instead of a double-word). Back in the day, you would never allocate twice the memory if you didn't need to. Mozilla could change this, but the request never had any urgency before because few webmasters used gigantic images. Now in the age of user created content, the problem may continue to grow and someone may want to increase its priority.

more options

That is likely inherited from the original Netscape code.
It is not trivial to change the size of a variable as this requires to check all code that is involved to make sure that they all use this larger type and that no implicit conversion gets in the way.

more options

Okay jscher2000 & cor-el,

I appreciate the input. With this information I can actually come up with a plan of action. However when I tried to use the Sprite in Firefox it failed silently! As I said earlier, the browser tool "Network" tab showed the Sprite loaded! And so I was scratching my head for three days.

Don't you think it might be appropriate to come up with a error message that actually tells the user what failed. And NO I do not think that 'This image cannot be displayed because it contains errors' is sufficient. If I had received this error it would have been worse, I would have been searching for image errors, FOREVER!!!!!

I used to like Firefox and I'm sure I do not understand all of the issues that you face given the level of change and the number of devices you have to contend with. But this last year I have had a dozen reasons to search the Internet for solutions to issues regarding Firefox. I have to say there is a lot of anger out there.

I wish you well but as a developer I also have to deal with a lot of programming issues. Browser related issues can be some of the most frustrating. Just saying!

regards, TC