Skip to content

Try-catch in Imagine\Gmagick\Effects::convolve should catch GmagickException instead of ImagickException #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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