Skip to content

Commit 9e90d32

Browse files
committed
Throw error if quality is not an integer
1 parent 28202fc commit 9e90d32

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ImageConverter.php

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ private function saveImage($to, $image, $quality)
8585
$this->makeDirectory($to);
8686
}
8787

88+
89+
if(isset($quality) && !is_int($quality)) {
90+
throw new \InvalidArgumentException(sprintf('The %s quality has to be an integer', $quality));
91+
}
92+
8893
switch ($extension) {
8994
case 'gif':
9095
$image = imagegif($image, $to);

0 commit comments

Comments
 (0)