From 178c1586188369b45d654aa4d3beeb19ef9399a4 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G4C80F7\\geckon01" Date: Mon, 25 Mar 2024 15:47:20 +0300 Subject: [PATCH] Fixed Class "http\Exception\BadUrlException" not found exception --- src/SimpleImageCompressor.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SimpleImageCompressor.php b/src/SimpleImageCompressor.php index 2ae1b45..1e94a10 100644 --- a/src/SimpleImageCompressor.php +++ b/src/SimpleImageCompressor.php @@ -8,7 +8,6 @@ namespace geckon01\SimpleImageCompressor; -use http\Exception\BadUrlException; /** * Class SimpleImageCompressor @@ -135,7 +134,7 @@ class SimpleImageCompressor $imageData = file_get_contents($this->imageResourceUrl); if($imageData === false) - throw new BadUrlException("Cannot load image from provided resource: ".$this->imageResourceUrl); + throw new \Exception("Cannot load image from provided resource: ".$this->imageResourceUrl); $this->imageData = $imageData; } @@ -150,7 +149,7 @@ class SimpleImageCompressor public function resizeAndCompress($reductionPercent = 5, $quality = 90): CompressedImage { $originImage = imagecreatefromstring($this->imageData); - + if($originImage === false) throw new \Exception("Can not read provided file");