Skip to content

Commit

Permalink
Decide which clone to use based on version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
lenar committed May 3, 2012
1 parent d3b1f4c commit 7c2037b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Imagine/Imagick/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public function __destruct()
public function copy()
{
try {
$clone = clone $this->imagick;
if (version_compare(phpversion("imagick"), "3.1.0b1", ">=")) {
$clone = clone $this->imagick;
} else {
$clone = $this->imagick->clone();
}
} catch (\ImagickException $e) {
throw new RuntimeException(
'Copy operation failed', $e->getCode(), $e
Expand Down

0 comments on commit 7c2037b

Please sign in to comment.