feat: rewrite ImageMagickHandler to rely solely on the PHP imagick extension#9526
Merged
michalsn merged 2 commits intocodeigniter4:4.7from Apr 22, 2025
Merged
Conversation
paulbalandan
approved these changes
Apr 18, 2025
Member
|
Would this fix #6149 ? Or performance is still somehow the same? |
Member
Author
|
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. |
Member
Author
|
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);
|
ddevsr
approved these changes
Apr 22, 2025
6b1884a to
935b734
Compare
Co-authored-by: John Paul E. Balandan, CPA <paulbalandan@gmail.com>
935b734 to
7ae3d42
Compare
Member
Author
|
Thank you for the review @paulbalandan, and everyone else for the feedback. |
This was referenced Apr 22, 2025
Collaborator
|
Btw, missing required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: