Skip to content

Commit 200d66d

Browse files
authored
Merge pull request #757 from dmitry-kulikov/fix/gmagick-convolve
Try-catch in Imagine\Gmagick\Effects::convolve should catch GmagickException instead of ImagickException
2 parents 60a78ce + 931ecb1 commit 200d66d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Gmagick/Effects.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function negative()
8282
public function grayscale()
8383
{
8484
try {
85-
$this->gmagick->setImageType(2);
85+
$this->gmagick->setimagetype(2);
8686
} catch (\GmagickException $e) {
8787
throw new RuntimeException('Failed to grayscale the image', $e->getCode(), $e);
8888
}
@@ -118,7 +118,7 @@ public function sharpen()
118118
public function blur($sigma = 1)
119119
{
120120
try {
121-
$this->gmagick->blurImage(0, $sigma);
121+
$this->gmagick->blurimage(0, $sigma);
122122
} catch (\GmagickException $e) {
123123
throw new RuntimeException('Failed to blur the image', $e->getCode(), $e);
124124
}
@@ -168,7 +168,7 @@ public function convolve(Matrix $matrix)
168168
}
169169
try {
170170
$this->gmagick->convolveimage($matrix->getValueList());
171-
} catch (\ImagickException $e) {
171+
} catch (\GmagickException $e) {
172172
throw new RuntimeException('Failed to convolve the image');
173173
}
174174

tests/tests/Gmagick/EffectsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function setUpBase()
4040
*/
4141
public function testColorize()
4242
{
43-
$this->isGoingToThrowException('Imagine\Exception\RuntimeException');
43+
$this->isGoingToThrowException('Imagine\Exception\NotSupportedException');
4444
parent::testColorize();
4545
}
4646

0 commit comments

Comments
 (0)