Cannot open large PNG
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.
Gekose oplossing
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.
Lees dié antwoord in konteks 👍 1All Replies (10)
Please post a link to the image.
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".
Gekose oplossing
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.
Got it - The Image is 900x40000 pixels. That explains it. I can limit it to 30000 or less and will do so. Thanks.
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.
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.
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
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.
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.
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