当我转到使用 imagegd2() 生成的图像 URL 时,我收到“imagegd2():无法打开临时文件”错误消息,例如:
$image->make($data['path']);
$image->resize(100, null, true)->crop(70, 70);
// create response and add formated image
$response = Response::make($image->encode('png'));
// set content-type
$response->header('Content-Type', 'image/png');
它与权限和 OSX 有关,因为在 linux 开发环境中工作正常。