php icon indicating copy to clipboard operation
php copied to clipboard

Add Imagick extension

Open fifle opened this issue 2 years ago • 3 comments

Feature Request

It looks like Imagick extension is missing for now. I'm using a library for generating QR-code in my Laravel application and it requires the support of Imagick for generating QR-code images in PNG format (I also need it for user to be downloadable, so it's really needed).

It looks like it's a tiny extension and won't bring troubles with issues with lambda. http://pecl.php.net/package/imagick

fifle avatar Mar 31 '22 09:03 fifle

Hi @f3l1x ! Is there any chance to get this update for upcoming releases? Heroku is closing it's free tier soon and I'm looking forward for moving to Vercel this month. So maybe, it will be possible due to adding Imagick extension into your runtime :)

testliopavel avatar Sep 28 '22 05:09 testliopavel

Hi @testliopavel, I will take a look. I hope imagick will be not 20 MB binary :-D

f3l1x avatar Oct 01 '22 08:10 f3l1x

There is a little problem with imagick on AmazonLinux 2 with Remi's RPM repository (https://blog.remirepo.net/pages/PECL-extensions-RPM-status).

#10 23.50 --> Processing Dependency: libraw_r.so.19()(64bit) for package: ImageMagick6-libs-6.9.12.64-1.el7.remi.x86_64
#10 23.50 ---> Package libpciaccess.x86_64 0:0.14-1.amzn2 will be installed
#10 23.50 --> Processing Dependency: hwdata for package: libpciaccess-0.14-1.amzn2.x86_64
#10 23.50 --> Running transaction check
#10 23.50 ---> Package ImageMagick6-libs.x86_64 0:6.9.12.64-1.el7.remi will be installed
#10 23.51 --> Processing Dependency: libraw_r.so.19()(64bit) for package: ImageMagick6-libs-6.9.12.64-1.el7.remi.x86_64
#10 23.51 ---> Package hwdata.x86_64 0:0.252-9.3.amzn2 will be installed
#10 23.54 --> Finished Dependency Resolution
#10 23.61 Error: Package: ImageMagick6-libs-6.9.12.64-1.el7.remi.x86_64 (remi)
#10 23.61            Requires: libraw_r.so.19()(64bit)
#10 23.61  You could try using --skip-broken to work around the problem
#10 23.66  You could try running: rpm -Va --nofiles --nodigest

According to Bref (alternative tool for serverless PHP), there is so much dependencies for Imagick extension. Vercel Serverless Functions have hard limit of 50Mb. In this case we'd need to use another AWS lambda layer.

https://github.com/brefphp/extra-php-extensions/blob/105f25ab3cdc12188ca031cef4205ff033d16b83/layers/imagick/Dockerfile#L70-L109

Anyway, I am still investigating how to do it. But I have no ETA at this moment.

f3l1x avatar Oct 01 '22 16:10 f3l1x