Home > php教程 > php手册 > php resizeimage 部分jpg文件 生成缩略图失败,

php resizeimage 部分jpg文件 生成缩略图失败,

WBOY
Release: 2016-06-13 08:43:57
Original
831 people have browsed it

php resizeimage 部分jpg文件 生成缩略图失败,

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

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

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

<span>1</span> <span>ini_set</span>('gd.jpeg_ignore_warning', <span>true</span>);
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template