Image corrupt or truncated: <unknown>, Firefox 4

I’m a Firebug user, and we’d been seeing some very strange errors in Firefox 4 on a site that was running without any obvious errors.  In the Console tab, the following error was showing up.

Image corrupt or truncated: <unknown>

This is almost as unhelpful as it gets, unfortunately!  All we know is that there’s an image that seems to be causing a problem.  There’s no line information, no offending image reference, and no other clues that help us track things down.

Some other detectives had tracked this down to the favicon.ico, and blamed this on a Firefox 4 error.

http://code.google.com/p/fbug/issues/detail?id=4291

When we opened up the favicon.ico file on its own, sure enough, the error still popped up.  I’m not sure how the original icon was generated, but something was invalid in the actual file.

It’s great that browsers and other applications are error-tolerant.  It can lead to a false sense of stability though, and in this case, the phantom error was appearing even though the image was loading properly.  Once we generated a valid favicon.ico file and replaced the old one, the error disappeared.

This entry was posted in Uncategorized. Bookmark the permalink.

11 Responses to Image corrupt or truncated: <unknown>, Firefox 4

  1. Rajat Arora says:

    Its a problem with Firefox. Please see the issue raised under mozilla:
    https://bugzilla.mozilla.org/show_bug.cgi?id=646090

    • swrittenb says:

      That’s true, and I linked to a Firefox discussion about it in the post. My interest was related to why it was happening in our case though. For us, the favicon.ico file was invalid in some way. We generated a new favicon.ico using a new program, and the error disappeared.

      It may be the case that future versions of Firefox 4 prevent this error from occurring. We just wanted it gone in the meantime.

  2. Rajat Arora says:

    I fixed the problem by putting , in the document header and removing it from all other places.
    Also, make sure the path to “favicon.ico” is correct. :-)

  3. Rajat Arora says:

    Last comment didn’t show up the complete text. Here is another post:

    I fixed the problem by putting the line , in the document header and removing the include from all other places. Also, make sure the path to “favicon.ico” is correct.

  4. Dd says:

    I had a similar issue. CSS background-images were being reported as corrupted or truncated. The fix was to ensure that the image urls were wrapped in quotes.

    background : url (“image_url”)

    not

    background : url ( image_url )

  5. Dd says:

    Disregard my previous comment, my fix did not actually fix my problem.

  6. I used a PNG, just changed the name to favicon.ico, I will convert to ICO and see if the error continues.

    hug.

  7. Yuan Yuan says:

    Have a look, thank you for telling that it’s a problem with Firefox.

  8. klaus says:

    had the same error but it was something other:
    my problem was i forgot that i changed the transfer typ in my ftp program from auto to ascii and so he uploaded this .png file wrong!
    switching back, upload again and everthing was fine :)

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>