From 4aaf1e6cb3603068f7e8d25d5b22ab684d096889 Mon Sep 17 00:00:00 2001 From: Libern Date: Fri, 10 Jan 2020 23:43:22 +0800 Subject: [PATCH] Improved image --- src/Someline/Image/SomelineImageService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Someline/Image/SomelineImageService.php b/src/Someline/Image/SomelineImageService.php index b2b17d8..6a50def 100644 --- a/src/Someline/Image/SomelineImageService.php +++ b/src/Someline/Image/SomelineImageService.php @@ -401,6 +401,7 @@ public function showImage($template_name, $image_name, array $image_templates = } $file = $storageDisk->get($file_path); + $full_file_path = $storageDisk->path($file_path); $type = $storageDisk->mimeType($file_path); // if gif or original @@ -408,11 +409,10 @@ public function showImage($template_name, $image_name, array $image_templates = $response = response($file, 200) ->header('Content-Type', $type); } else { - // convert to image - $img = Image::cache(function ($image) use ($file, $imageTemplate) { + $img = Image::cache(function ($image) use ($full_file_path, $imageTemplate) { /** @var \Intervention\Image\Image $image */ - $image = $image->make($file)->orientate(); + $image = $image->make($full_file_path)->orientate(); // resize if (!$imageTemplate->isOriginal()) {