From fe1ea81a5ab81b6df7647b40d42e62a94f4b5f4e Mon Sep 17 00:00:00 2001 From: physixc Date: Fri, 26 Jan 2024 10:30:09 +0100 Subject: [PATCH] Fix bug where image path was not set correctly (#24) --- src/Actions/ResizeImage.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Actions/ResizeImage.php b/src/Actions/ResizeImage.php index 566f018..e8e4cc8 100644 --- a/src/Actions/ResizeImage.php +++ b/src/Actions/ResizeImage.php @@ -18,12 +18,11 @@ public function resize(Asset $asset, ?int $width = null, ?int $height = null): v // Prevents exceptions occurring when resizing non-compatible filetypes like SVG. try { - $path = $asset->resolvedPath(); - $orientedImage = Image::make($path)->orientate(); + $orientedImage = Image::make($asset->resolvedPath())->orientate(); $image = (new Size())->runMaxResize($orientedImage, $width, $height); - $asset->disk()->filesystem()->put($path, $image->encode()); + $asset->disk()->filesystem()->put($asset->path(), $image->encode()); $asset->merge(['image-optimized' => '1']);