Answer the question
In order to leave comments, you need to log in
How to rewrite resize in opencart so that the image quality does not change and it becomes square?
Good afternoon!
How to rewrite resize in opencart so that the product image goes into the cache with the same quality (i.e. the quality does not change), and the image size simply becomes square (i.e. if 600 * 400, then it becomes 600 * 600, and if 400*450 - then 450*450) and at the same time a bunch of thumbnails were not created - only one original image, but square?
Those. resize should only result in making the product image square - everything else remains the same - quality, etc. must be the same as the original.
Answer the question
In order to leave comments, you need to log in
if you do not need to change the quality, then just pass the path to the image,
if you still need to do resize, then get the image dimensions, determine the large side and then resize the image to a square, but my advice then is to make the margins transparent, the white margins may not fit in design
There is a ready modifier for this. It's called Don't Resize Product Images . It just cancels the image resizing on the product page, showing the original uploaded photo.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question