CentOS 7下关于 PHP GD问题
环境:
centos 7
php 5.6.11
jpegsrcv.v9a
使用 imagecreatefromjpeg 的时候报如下错误:
imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error:
is not a valid JPEG file
使用函数 getimagesize 检测图片没问题,路径没问题,文件权限均是755。
再三编译也没办法解决,仔细检查编译也没有出错,不知是哪里问题,望高人指点。
売小刀
9 years, 8 months ago
Answers
试试用finfo_file检查一下文件类型.
php官方有人说:
If you get this error: "Warning: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error" then check the JPEG files. If they are saved in CMYK format (instead of RGB) then GD will fail to load them (tested with GD 2.0.12)
小路lvv
answered 9 years, 8 months ago