-
Couldn't load subscription status.
- Fork 2k
feat: rewrite ImageMagickHandler to rely solely on the PHP imagick extension
#9526
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
Conversation
|
Would this fix #6149 ? Or performance is still somehow the same? |
|
Yes, it should be better. Using the imagick extension can actually be faster than CLI in many cases because we load and manipulate images entirely in memory. This may not be true only for very large files. It would be great if someone with a real-world use case could check this out. |
|
I ran some tests with a PNG image that was 6.7 MB in size. $iterator = new \CodeIgniter\Debug\Iterator();
$iterator->add('imagick', static function () {
service('image', 'imagick')
->withFile(WRITEPATH . '/test/mypic.png')
->flip()
->resize(500, 500, true)
->text('Copyright 2025 My Photo Co', [
'color' => '#fff',
'opacity' => 0.5,
'withShadow' => true,
'hAlign' => 'center',
'vAlign' => 'bottom',
'fontSize' => 20,
'padding' => 20,
])
->save(WRITEPATH . '/test/image.jpg');
});
return $iterator->run(10);
|
6b1884a to
935b734
Compare
Co-authored-by: John Paul E. Balandan, CPA <[email protected]>
935b734 to
7ae3d42
Compare
|
Thank you for the review @paulbalandan, and everyone else for the feedback. |
|
Btw, missing required |
Description
This PR rewrites
ImageMagickHandlerto rely solely on the PHPimagickextension.Since we required this extension from the beginning, there should be no problems for users.
Fixes #9512
Checklist: