Answer the question
In order to leave comments, you need to log in
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:
How it should be:
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. 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 questionAsk a Question
731 491 924 answers to any question