Jump to content

Best way to Resize and Crop images. Prestashop 1.7


Recommended Posts

Prestashop 1.7 default functionality limits us to only resizing images. 

I wonder what you usually use when you want to get desired size of an image? Do you make some code overrides or use some module?

What would be the code solution/module that takes a width and height and will resize and crop the image to ensure the resulting image is the exact size I requested. The aspect ratio is maintained but parts of the image may be cropped, however the resulting image is centered?

For example if I have an image that is 640 x 480 and requested 400 x 100 image, I would expect the resulting image will be resized to 400 x 300 and then the height is cropped resulting in a 400 x 100 image.

Edited by mantas393
More info (see edit history)

Share this post


Link to post
Share on other sites

The final effect always depends on specific images that you have. I think you can get the result that you want but if you want to be sure you can show me some images that you have now and I'll check it out.

Also please remember, that it may also depend on your theme. Even with a 400x100 image the theme may sometimes force some different size or container.

Share this post


Link to post
Share on other sites

I can edit CSS, so it's not a problem. I will not be the one uploading pictures, I want it to work with any given image dimensions.

I wrote one module that displays some images on main page and used PHP GD library functions to crop and resize those images, then I though I could use same approach and somehow override the default resizing functionality, but it seems way too much of a hassle, so i'm willing to pay for some solution.

Share this post


Link to post
Share on other sites

So this module makes such an override. Instead of further resizing the image and adding white stripes around it, it crops out part of images exceeding the desired size.

  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More