Imagick Issue

Getting this error with imagick
Function Imagick::setimageopacity() is deprecated
Any ideas? Thanks

Getting this error with imagick
Function Imagick::setimageopacity() is deprecated
Any ideas? Thanks

Seems to be self explanatory. Function is deprecated and CS-Cart takes ages to patch it again. So you are best off just placing a '@' in front of the function call.

How do I do that?

I simply use only the GD and not the imagick.

I tried to set in the php options to ignore all errors and not display it but still displays them!

So I enabled GD only (and not the imagick or both of them) in the php settings and it works.

Cs cart says that will have problem with large sizes but honestly speaking we use jpg and optimal sizes in order to save space in our server and to load faster so we should not use large images by definition.

Same issue here, what is going on CS Cart?

Hi,

I have the same issue. I hope CS-cart team see this and help since they recommend to use imagick :?

CS-Cart - when one if (method_exists($imagick, 'setImageAlpha')) takes ages ... :?

Here is the latest version of the file for anyone wanting to try it.

/app/lib/vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php

[attachment=13950:Imagine.php]

Edit: Actually there are quite a few changes so you may just want to replace the following code.

Find:

                    $imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA));

Replace:

                    ErrorHandling::ignoring(E_DEPRECATED, function () use ($imagick, $pixel) {
                        $imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA));
                    });

Imagine.php

Since there were so many changes to the Imagine.php file, I went ahead and updated all of the files for imagine. So far it has been running fine for most of the day. I have attached the files. Upload to the root of your installation and extract.

[attachment=13951:Imagine_update.zip]

Imagine_update.zip

Thanks for the zip @tool! Doesn't seem like a complex issue for cs-cart to have included in the 4.10.x updates.

No problem.

You know, as well as I, that CSC doesn't update unless it's an issue for their entire customer base. I am guessing that most haven't updated to imagick 3.4.4 because I didn't have the issue until I did.

No problem.

You know, as well as I, that CSC doesn't update unless it's an issue for their entire customer base. I am guessing that most haven't updated to imagick 3.4.4 because I didn't have the issue until I did.

There are still so many flaws that have not yet been fixed. I still have simple to implement features from 4 years ago that have not yet been implemented (even after giving them a diff file on how to patch it). Now, even though this is unspeakable, what I found truly annoying, is that when Simtech requires something adjusted (e.g. SDK's for Amazon Pay), that CS-Cart clears their schedule immediately and prioritizes their requests. This is fair from a business perspective but now it is out of proportion. We asked this 2 years ago, so that we could use things like SES / SQS without an API that is as old as it gets. Now this summer, Simtech wanted to implement 'Amazon Pay', but for that, you need newer SDK's from Amazon. And ofcourse, these SDK's were immediately updated, without a hassle.

But that's not all. There are many things that CS-Cart can do to optimize the loading times of their store and their overall code quality. We still come across poorly documented code on a daily basis and when we report it, nothing is done with it. What's more, is that we are happy to contribute in some changes via pull requests (a code change request) but they simply will not allow it.

This has been going back and forth for many years now, until last summer. We simply decided to write our own e-commerce solution (for now private source), that provides way better speeds and actually updated API's and many more things. Besides that, it can also be scaled over multiple servers across multiple datacenters whilst maintaining an average TTFB of ~120ms. CS-Cart could have been like this, if they actually took our variety of tips for granted and listened to our tries to help them make the required technological changes.

But, it is what it is...

Since there were so many changes to the Imagine.php file, I went ahead and updated all of the files for imagine. So far it has been running fine for most of the day. I have attached the files. Upload to the root of your installation and extract.

attachicon.gif Imagine_update.zip

Thank you so much for your help, hopefully CS-cart team see this. It is suck that CS-cart team let others to fix their problem

it fix 4.11 and above

/app/lib/vendor/imagine/imagine/lib/Imagine/Imagick/Imagine.php

Change this

$imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA));

With This one
$imagick->evaluateImage(\Imagick::EVALUATE_MULTIPLY, $pixel->getColorValue(\Imagick::COLOR_ALPHA), \Imagick::CHANNEL_ALPHA );