Skip to content

Commit

Permalink
Merge pull request #757 from dmitry-kulikov/fix/gmagick-convolve
Browse files Browse the repository at this point in the history
Try-catch in Imagine\Gmagick\Effects::convolve should catch GmagickException instead of ImagickException
  • Loading branch information
mlocati committed Sep 30, 2021
2 parents 60a78ce + 931ecb1 commit 200d66d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Gmagick/Effects.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function negative()
public function grayscale()
{
try {
$this->gmagick->setImageType(2);
$this->gmagick->setimagetype(2);
} catch (\GmagickException $e) {
throw new RuntimeException('Failed to grayscale the image', $e->getCode(), $e);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ public function sharpen()
public function blur($sigma = 1)
{
try {
$this->gmagick->blurImage(0, $sigma);
$this->gmagick->blurimage(0, $sigma);
} catch (\GmagickException $e) {
throw new RuntimeException('Failed to blur the image', $e->getCode(), $e);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ public function convolve(Matrix $matrix)
}
try {
$this->gmagick->convolveimage($matrix->getValueList());
} catch (\ImagickException $e) {
} catch (\GmagickException $e) {
throw new RuntimeException('Failed to convolve the image');
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Gmagick/EffectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function setUpBase()
*/
public function testColorize()
{
$this->isGoingToThrowException('Imagine\Exception\RuntimeException');
$this->isGoingToThrowException('Imagine\Exception\NotSupportedException');
parent::testColorize();
}

Expand Down

0 comments on commit 200d66d

Please sign in to comment.