批量处理图片出现错误!!

2016-07-07 15:26 来源:www.chinab4c.com 作者:ecshop专家


  1. Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file in E:\wwwroot\mmxncn\web\includes\cls_image.php on line 656

  2. Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'E:/wwwroot/mmxncn/web/images/201003/source_img/1000_P_12692648201803.jpg' is not a valid JPEG file in E:\wwwroot\mmxncn\web\includes\cls_image.php on line 656

  3. Warning: imagecopyresampled(): supplied argument is not a valid Image resource in E:\wwwroot\mmxncn\web\includes\cls_image.php on line 228

  4. Warning: imagedestroy(): supplied argument is not a valid Image resource in E:\wwwroot\mmxncn\web\includes\cls_image.php on line 286
  5. {"error":0,"message":"","content":"","done":2,"do_album":1,"do_icon":1,"goods_id":"0","brand_id":0,"cat_id":33,"thumb":1,"watermark":1,"change":0,"page_size":50,"module_no":1,"page":2,"total":2,"silent":1,"row":{"pre_id":"time_1","pre_time":"\u8017\u65f6 6 \u79d2","cur_id":"time_2","new_page":"\u7b2c 2 \u9875","new_total":"\u5171 1 \u9875","new_time":"\u6b63\u5728\u5904\u7406....."}}
复制代码

回答:
我查了下图片格式是没错的,不过不完整,只有半个图片!估计是图片本身出现问题了,现在就是想知道怎么判断图片有问题,跳过这个有问题的图片,处理下一个~

期待高手解答,图片很多,一个一个去找有点不太现实。

php能否检查图片是否损坏

请问一次处理多少图片?

没有遇到这种情况

大概500多张,确认是图片文件损坏了,后来通过PS批量修改下,已经Ok~~