From e09acf811085cfc85bf7ade7e9ead1414b04cc75 Mon Sep 17 00:00:00 2001 From: Rickiewars <29739029+rickiewars@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:27:42 +0200 Subject: [PATCH] Crop with x/y values of 0 was not being applied correctly. When cropping an image and moving the crop-area to the top left of the image, the crop was not being applied correctly. Instead the crop was being centered again. --- src/Models/Traits/HandlesConversions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Traits/HandlesConversions.php b/src/Models/Traits/HandlesConversions.php index 91e9a85..b47a538 100644 --- a/src/Models/Traits/HandlesConversions.php +++ b/src/Models/Traits/HandlesConversions.php @@ -53,7 +53,7 @@ public function generate(bool $force = false) : void $conversionFile = SpatieImage::useImageDriver(config('image-library.image_driver')) ->loadFile($this->image->getPath()); - if ($this->x || $this->y) { + if (isset($this->x) || isset($this->y)) { $conversionFile ->manualCrop($this->width, $this->height, $this->x, $this->y); } else {