Home  >  Article  >  php教程  >  php resizeimage 部分jpg文件 生成缩略图失败的原因分析及解决办法,

php resizeimage 部分jpg文件 生成缩略图失败的原因分析及解决办法,

WBOY
WBOYOriginal
2016-06-13 08:43:34843browse

php resizeimage 部分jpg文件 生成缩略图失败的原因分析及解决办法,

今天遇到GD的resizeimage 函数处理jpg后缀文件的缩略图的时候 提示该图片不是合法的jpg图片并报错

<b>Warning</b>: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SOS parameters for sequential JPEG 

国内网上查了很多资料也没找到有效的解决办法,原来只要把 GD的jpeg文件支持打开即可解决

ini_set('gd.jpeg_ignore_warning', true); 

在开头写上上边这行代码 或者 在php.ini文件里把这个配置打开即可

以上内容是针对php resizeimage 部分jpg文件 生成缩略图失败的原因分析及解决办法,希望对大家有所帮助!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn