2 Commits

Author SHA1 Message Date
geckon01 dca7db5442 Bump package version 2024-03-25 15:48:59 +03:00
geckon01 178c158618 Fixed Class "http\Exception\BadUrlException" not found exception 2024-03-25 15:47:20 +03:00
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "geckon01/simple-image-compressor", "name": "geckon01/simple-image-compressor",
"description": "SimpleImageCompressor is a tiny simple PHP image compressor lib which allows you to compress any image easily on the fly", "description": "SimpleImageCompressor is a tiny simple PHP image compressor lib which allows you to compress any image easily on the fly",
"version": "0.3.10.17", "version": "0.4.3.25",
"keywords": [ "keywords": [
"php", "php",
"images", "images",
+2 -3
View File
@@ -8,7 +8,6 @@
namespace geckon01\SimpleImageCompressor; namespace geckon01\SimpleImageCompressor;
use http\Exception\BadUrlException;
/** /**
* Class SimpleImageCompressor * Class SimpleImageCompressor
@@ -135,7 +134,7 @@ class SimpleImageCompressor
$imageData = file_get_contents($this->imageResourceUrl); $imageData = file_get_contents($this->imageResourceUrl);
if($imageData === false) 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; $this->imageData = $imageData;
} }
@@ -150,7 +149,7 @@ class SimpleImageCompressor
public function resizeAndCompress($reductionPercent = 5, $quality = 90): CompressedImage public function resizeAndCompress($reductionPercent = 5, $quality = 90): CompressedImage
{ {
$originImage = imagecreatefromstring($this->imageData); $originImage = imagecreatefromstring($this->imageData);
if($originImage === false) if($originImage === false)
throw new \Exception("Can not read provided file"); throw new \Exception("Can not read provided file");