日期:2014-05-17  浏览次数:20651 次

FF错误控制台报Image corrupt or truncated:http...的错
浏览器:火狐18.0.1
html头:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
css中的代码:
.xxx {
width: 1024px;
height: 768px;
position: absolute;
-webkit-text-size-adjust: none;
background-image: url(../../../xx/xxx/xxx.jpg);
zoom: 0.15;
-moz-transform: scale(0.15) translate(-2830px, -2110px);
}

错误信息:Image corrupt or truncated:http://localhost/xxx/xxx/xx/xxx/xxx.jpg
触发方式:清掉火狐的缓存,刷新页面,无错,再次刷新,出错,再刷新,再出错。
其他情况:已排除图片文件本身损坏的可能,以及路径错误的可能,在报错的时候该样式仍可正常生效,图片也显示正常(清掉缓存后和二次刷新后均可正常显示)。

请教大家Image corrupt or truncated:http://localhost/xxx/xxx/xx/xxx/xxx.jpg这个错误如何解决??

------解决方案--------------------
你把http://localhost/xxx/xxx/xx/xxx/xxx.jpg复制一下,粘贴到浏览器地址栏里面,看一下有没有图片。
------解决方案--------------------
你的图片是不是太大了?多少字节?
多数是客户端没下载完整
------解决方案--------------------
引用:
浏览器:火狐18.0.1
html头:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
css中的代码:CSS code?123456789.xxx {    width: 1024px;    height: 7……

也许你这张图片不是jpg,换成另一个确定是jpg的图片试试,如果没有报错就是图片后缀的问题。
------解决方案--------------------
jpg是以字节FFD9结尾的,并且整个jpg文件也只有一个FFD9,估计火狐通过这个判断的
#8说的也是一种可能,就是用了非jpg格式的图片但发jpg的mimetype(或扩展名,不知道FF有没检测mimetype),FF没有读到FFD9就认为jpg文件未传完/错图