Topic: php-imagick 3.4.3 setImageAlpha function problem

Hi!
I have SentOS 7 LEMP system with php 7.1.

I using php-imagick module from REMI. All was fine untill it updates to 3.4.4 version. In this version function imagick::setImageOpacity was marked as deprecated and warning messages start to appear in my site project. I tried to replace it with new one setImageAlpha  but it do not work. Here is test script:

<?php
$imagick = new \Imagick();
var_dump(method_exists($imagick, 'setImageAlpha'));
echo ('<br />');
var_dump(method_exists($imagick, 'setImageOpacity'));
echo ('<br />');

And there is the result:
bool(false)
bool(true)


I have downgrade php-imagick to 3.4.3 version. Messages disappeared but script still not work with setImageAlpha.
I have tried to install ImageMagick from BASE repo version 6.7.8.9 and tried to install ImageMagick6 6.9.10.46 from REMI but it was given no results.

How should I correctly set up imagick with REMI and do not afraid problems during update ???

Re: php-imagick 3.4.3 setImageAlpha function problem

Deprecation is not a "error", only an information (which is not displayed in "production" setting)

These function have been deprecated long time ago in ImageMagick 6

The "imagick" extension package still use IM 6 to provide full features, but I also think it make sense to give this information to user

Next  major version (which will probably be imagick 4.0.0), will drop support to IM 6, so will only support IM 7 and thus won't have these deprecated functions.

See upstream changelog: https://pecl.php.net/package-changelog. … ge=imagick

> How should I correctly set up imagick with REMI and do not afraid problems during update ???

As next majhor version of imagick will break API, I will provide it as a new package "php-pecl-imagick4" so user will have the choice to update or not to the new API.

Notice: this is what I'm used to, see php-pecl-swoole4, php-pecl-redis4, ...


P.S. notice that some dsitribution already use imagick build with IM 7, so don't have these functions, so your script is NOT portable.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

3 (edited by 781330 2019-05-27 13:20:36)

Re: php-imagick 3.4.3 setImageAlpha function problem

... so finally if I only want imagick extension be latest version - which steps of installation should I make?


ImageMagick7-libs
and
php-pecl-imagick

from REMI are enough ???

In other words: Is it possible to run php-pecl-imagick extention on ImageMagick7-libs with 7-th version commands support?

Re: php-imagick 3.4.3 setImageAlpha function problem

> ImageMagick7-libs and php-pecl-imagick

As written in my previous answer:

     The "imagick" extension package still use IM 6 to provide full features, but I also think it make sense to give this information to user

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: php-imagick 3.4.3 setImageAlpha function problem

Is it able to work if I'll install ImageMagick7 and ImageMagick7-devel from remi-repo and then build imagick from native pecl?

Re: php-imagick 3.4.3 setImageAlpha function problem

> Is it able to work if I'll install ImageMagick7 and ImageMagick7-devel from remi-repo and then build imagick from native pecl?

Yes, but you will loose the deprecated functions

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: php-imagick 3.4.3 setImageAlpha function problem

BTW, still don't understand what is your goal....

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: php-imagick 3.4.3 setImageAlpha function problem

Remi wrote:

BTW, still don't understand what is your goal....

lol It looks like me too smile

If I say - that new and depricated function works both?

When i use this combination

# yum list installed | grep -i magick
ImageMagick6-libs.x86_64 6.9.10.46-1.el7.remi @remi-safe
php-pecl-imagick.x86_64 3.4.4-1.el7.remi.7.1 @remi-php71

then setImageAlpha function is absent in system. But old (deprecated) setimageopacity function generates "Deprecated" warning message sciense imagick 3.4.4.

Re: php-imagick 3.4.3 setImageAlpha function problem

Ok, understand now.

The problem is that setImageAlpha is not yet in documentation, so was confused with setImageAlphaChannel...

Indeed the new method will be available when imagick will be build against IM 7 (and the old removed)

> If I say - that new and depricated function works both?

Dream... wink

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi