N
N
nikkon822019-08-25 14:29:03
opencart
nikkon82, 2019-08-25 14:29:03

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

2 answer(s)
W
web-mechanic, 2019-09-06
@nikkon82

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

S
Serge Tkach, 2020-09-08
@SergeTkach

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 question

Ask a Question

731 491 924 answers to any question