A
A
Adik Izat2019-02-08 12:20:24
opencart
Adik Izat, 2019-02-08 12:20:24

How to remove image cropping in Opencart 3.x?

Good afternoon forum users! I ran into a problem with images in Opencart. Opencart always asks for image size when uploading. I would like to remove this functionality. Because the pictures that I upload are of different sizes and fixed height and width eliminate the possibility of adaptability. In addition, if I load an image of 200x180 in a 200x200 field, it will fill the empty spaces with white, which is very undesirable.
How opencart gives:
5c5d48e5b5242766635200.png
How it should be:
5c5d491a494c3970595792.png
In general, how to remove the width and height of the image everywhere?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-02-11
@JaxAdam

1. Option
Search and remove in all controllers where you need to remove resize:
2. Option
Fix the resize logic in system/library/image.php
If I'm not mistaken, you will only need to replace:
on the
Then he will simply scale the picture to the desired size on one of the sides. Test and tweak for yourself.
Option 2 is preferable. Because Not resizing images at all is a bad idea. You will have very heavy category pages, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question