Skip to content

Unable to work with pecl 3.4.4 and ImageMagick 6 #715

@samdark

Description

@samdark

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions