-
Notifications
You must be signed in to change notification settings - Fork 529
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
Use setImageAlpha instead of deprecated setImageOpacity #547
Conversation
lib/Imagine/Imagick/Imagine.php
Outdated
@@ -81,7 +81,11 @@ public function create(BoxInterface $size, ColorInterface $color = null) | |||
$imagick->setImageBackgroundColor($pixel); | |||
|
|||
if (version_compare('6.3.1', $this->getVersion($imagick)) < 0) { | |||
$imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA)); | |||
if (version_compare(phpversion('imagick'), '3.4.3', '>=')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use if (method_exists($imagick, 'setImageAlpha')) {
instead here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This fixes a backwards compatibility issue introduced with v3.4.3 of the php imagick extension. The method has been renamed to setImageAlpha. See the imagick release notes for more info. https://pecl.php.net/package-changelog.php?package=imagick&release=3.4.3 Fixes php-imagine#539
b6c944a
to
32af6fb
Compare
This works great! @romainneutron can this be merged soon? |
@romainneutron I'm also waiting for this. Could you consider merging this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me and works as expected.
@romainneutron Would be great, if you can merge this! Thanks! |
For anyone that can't wait for a merge; edit your composer.json to include this and update
|
@basz Ended up doing the exact same thing. Thanks though! |
Thanks @jdewit! |
Quick note; we need to set some PHPUnit |
Should be fixed here #557 |
Is it possible to push these changes to 0.6.x? |
@ersin-demirtas what's preventing you from upgrading Imagine? |
The liip/LiipImagineBundle is using this package, working on a symfony 2.8 project based on solely open source libraries with those libraries are sharing same dependencies. Don't have enough time to invest time unless it agreed to provide support for the previous version. I can probably maintain my own version. -- I am not being lazy 🗡 |
I'd ask the LiipImagineBundle maintainers to upgrade their dependencies |
This fixes a backwards compatibility issue introduced with
v3.4.3 of the php imagick extension. The method has been renamed to
setImageAlpha. See the imagick release notes for more info.
https://pecl.php.net/package-changelog.php?package=imagick&release=3.4.3
Fixes #539