Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-13 08:43:34
Original
842 people have browsed it

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

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

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

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

ini_set('gd.jpeg_ignore_warning', true); 
Copy after login

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

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

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!