-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Running 'bin/magento catalog:images:resize' doesn't check if an image was already resized before, therefore it is superslow as it always resizes all images #26796
Comments
Hi @hostep. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @hostep do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @shikhamis11. Thank you for working on this issue.
|
✅ Confirmed by @shikhamis11 Issue Available: @shikhamis11, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Thanks @shikhamis11 for verifying! I just tested some more on different clean Magento installations:
|
Please make sure any mods to this area also work in database media storage mode. It is often overlooked. |
Ahh yes. I should have spotted that in the PR before commenting. Changes look good, although also untested here. |
Hi @engcom-Alfa. Thank you for working on this issue.
|
The issue is still reproducible on 2.4-develop |
@hostep Many thanks! Great job |
#26801 got merged a while ago, so we can close this issue. No information was provided about in which Magento versions it will be fixed, but I'm guessing 2.4.0 and maybe 2.3.6? |
I'm pretty sure in Magento 2.1 (and maybe 2.2) when you ran
bin/magento catalog:images:resize
, it only resized images which weren't already resized before.This no longer seems to be the case in Magento 2.3.
I think this behavior got introduced by 4988790 (not verified yet)
Preconditions (*)
Steps to reproduce (*)
bin/magento catalog:images:resize
pub/media/catalog/product/cache/
bin/magento catalog:images:resize
againpub/media/catalog/product/cache/
has been altered, which means the images got resized again even if they already exist.Expected result (*)
bin/magento catalog:images:resize
should not re-save an already resized imageActual result (*)
bin/magento catalog:images:resize
re-saves already resized imagesTemp solution
This seems to resolve the issue after some very initial testing:
Postponing the initialization of the
$image
variable also has a very big impact on performance.The text was updated successfully, but these errors were encountered: