Skip to content
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

Unable to work with pecl 3.4.4 and ImageMagick 6 #715

Closed
samdark opened this issue May 29, 2019 · 2 comments
Closed

Unable to work with pecl 3.4.4 and ImageMagick 6 #715

samdark opened this issue May 29, 2019 · 2 comments

Comments

@samdark
Copy link

samdark commented May 29, 2019

Issue description

\Imagick::setImageOpacity() was deprecated in PECL extension version 3.4.4 and \Imagick::setImageAlpha() is not there before ImageMagick 7. In this case it fails with "Function Imagick::setimageopacity() is deprecated":

if (version_compare('6.3.1', $this->getVersion($imagick)) < 0) { // <-- using 6.7.7, passes
    // setImageOpacity was replaced with setImageAlpha in php-imagick v3.4.3
    if (method_exists($imagick, 'setImageAlpha')) { // <-- does not exist before 7.x.x
        $imagick->setImageAlpha($pixel->getColorValue(\Imagick::COLOR_ALPHA));
    } else {
        $imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA));
        // ^ throws deprecation error with PECL 3.4.4
    }
}

What version of Imagine are you using?

1.2.1-dev

What's the PHP version you are using?

Any.

What's the imaging library you are using [gd/imagick/gmagick/any]?

  • ImageMagick 6.7.7-10 2017-07-31 Q16
  • PECL extension version 3.4.4

What's the imaging library configuration

Does not matter.

Minimal PHP code to reproduce the error:

$imagine = new \Imagine\Imagick\Imagine();
$color = (new RGB())->color('FFF', 10);
$image = $imagine->create(new Box(100, 100), $color);
@samdark
Copy link
Author

samdark commented May 29, 2019

Imagick/imagick#288

@Danack
Copy link

Danack commented May 30, 2019

Fyi:

i) there were other methods that were deprecated also: https://pecl.php.net/package-changelog.php?package=imagick

ii) It is planned that this is the last version (other than security fixes) of Imagick that will support ImageMagick 6. Yeah I'm aware that this is going to be mildly annoying for some users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants