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

Use setImageAlpha instead of deprecated setImageOpacity #547

Merged
merged 1 commit into from
May 2, 2017

Conversation

jdewit
Copy link
Contributor

@jdewit jdewit commented Feb 20, 2017

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

@@ -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', '>=')) {
Copy link
Collaborator

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

Copy link
Contributor Author

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
@jdewit jdewit force-pushed the fix/set-image-opacity branch from b6c944a to 32af6fb Compare March 3, 2017 10:59
@MarkVaughn
Copy link

This works great! @romainneutron can this be merged soon?

@driq
Copy link

driq commented Apr 13, 2017

@romainneutron I'm also waiting for this. Could you consider merging this?

Copy link
Collaborator

@robfrawley robfrawley left a 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.

@petrmalina
Copy link

@romainneutron Would be great, if you can merge this! Thanks!

@basz
Copy link

basz commented May 1, 2017

For anyone that can't wait for a merge; edit your composer.json to include this and update

 "repositories": [
    {
      "type": "git",
      "url": "git@github.com:jdewit/imagine.git"
    }
  ],
  "require": {
    "imagine/imagine": "dev-fix/set-image-opacity as 0.6.4",
  },

@petrmalina
Copy link

@basz Ended up doing the exact same thing. Thanks though!

@robfrawley robfrawley merged commit e787304 into php-imagine:develop May 2, 2017
@robfrawley
Copy link
Collaborator

Thanks @jdewit!

@robfrawley
Copy link
Collaborator

robfrawley commented May 2, 2017

Quick note; we need to set some PHPUnit require-dev constraints to avoid Travis failures like this one: https://travis-ci.org/avalanche123/Imagine/jobs/227800856#L2805 Version 6+ removed the aliases to non-namespaces PHPUnit classes. @romainneutron

@romainneutron
Copy link
Collaborator

Should be fixed here #557

@ersin-demirtas
Copy link

Is it possible to push these changes to 0.6.x?

@mlocati
Copy link
Collaborator

mlocati commented Jul 2, 2019

@ersin-demirtas what's preventing you from upgrading Imagine?

@ersin-demirtas
Copy link

ersin-demirtas commented Jul 2, 2019

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 🗡

@mlocati
Copy link
Collaborator

mlocati commented Jul 2, 2019

I'd ask the LiipImagineBundle maintainers to upgrade their dependencies

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

Successfully merging this pull request may close these issues.

Call to undefined method Imagick::setImageOpacity()
9 participants