public function get_thumb($file,$type=true){
if(is_file('.'.$file)){
$image = \org\Image::init();
$image->open('.'.$file); //打开图片
//组合缩略图路径
if($type){
$width = config('thumb_width');
$height = config('thumb_height');
}else{
$width = config('product_width');
$height = config('product_height');
}
//单独使用必须保存在已经有的目录中,目前不会自动创建目录
$thumb = './attachment/'.date('Y-m-d').'/thumb'.$width.$height.time().'==.jpg';
$image->thumb($width,$height)->save($thumb);
return $thumb;
}
}错误提示:imagejpeg(./attachement/20160613/thumb5804001465785620==.jpg): failed to open stream: No such file or directory 最佳答案