Php 干预/图像上未正确显示的图像

Php 干预/图像上未正确显示的图像,php,laravel-5.6,intervention,Php,Laravel 5.6,Intervention,我在laravel上使用干预/图像包,但没有刷新页面,无法正确显示图像。一旦刷新页面,仅显示在图像上。我的代码如下: $productid = ProductImage::find($id); $filePath = base_path()."/storage/app/".$productid->productimage; header('Content-type: image/jpeg'); $img = Image::make($filePath); return $img->

我在laravel上使用干预/图像包,但没有刷新页面,无法正确显示图像。一旦刷新页面,仅显示在图像上。我的代码如下:

$productid = ProductImage::find($id);
$filePath = base_path()."/storage/app/".$productid->productimage; 
header('Content-type: image/jpeg');
$img = Image::make($filePath);
return $img->response('jpg');

如果我没有弄错的话,我猜你是说,如果不刷新页面,你希望在页面上显示新创建的图像,对吗?是的,但不是新创建的图像,现有图像有时会显示空图像图标