我不能上传图像与代码点火器,并得到以下错误。
遇到错误 严重程度:警告 消息: imagecreatefromjpeg():gd- JPEG,libjpeg:可恢复错误:序列JPEG的无效SOS参数 文件名:库/Image_lib.php 线路号码: 1455 遇到错误 严重程度:警告 消息: imagecreatefromjpeg():'/home/gsgsadh/public_html/uploads/a31d12f51b36659f5456e2530237e779.jpg‘不是有效的JPEG文件 文件名:库/Image_lib.php 线路号码: 1455
application/libraries/MY_Image_lib.php的函数image_create_gd
public function image_create_gd($path = '', $image_type = '')
{
if ($path === '')
{
$path = $this->full_src_path;
}
if ($image_type === '')
{
$image_type = $this->image_type;
}
switch ($image_type)
{
case 1:
if ( ! function_exists('imagecreatefromgif'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported'));
return FALSE;
}
return imagecreatefromgif($path);
case 2:
if ( ! function_exists('imagecreatefromjpeg'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported'));
return FALSE;
}
/*No.1455*/ return imagecreatefromjpeg($path); //****Line number is 1455****
case 3:
if ( ! function_exists('imagecreatefrompng'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));
return FALSE;
}
return imagecreatefrompng($path);
default:
$this->set_error(array('imglib_unsupported_imagecreate'));
return FALSE;
}
}解决办法是什么?如何更改代码?
发布于 2016-10-20 09:50:09
将PHP设置为忽略jpeg警告
ini_set ('gd.jpeg_ignore_warning', 1);在从just ()调用imagecreatefromjpeg之前的行中
https://stackoverflow.com/questions/38084987
复制相似问题