Jump to content

Product images - white space on landscape


Recommended Posts

Hi all

 

Currently my products have a mixture of landscape and portrait photos.

 

I set my product list images to have a maximum width of 220px and a maximum height of 280.

 

When I regen my images the portrait photos look great. However, my landscape photos have been resized so they are the same height as the portrait images.

 

The extra white space looks awful. Is there any way to fix this?

 

Thanks in advance

Link to comment
Share on other sites

Hi all any input on this?

 

I tried the following but no joy:

 

http://www.prestashop.com/forums/topic/15210-trick-crop-images-inside-preserve-ratio-no-white-spaces-arround-image/

 

Why is there a huge white space at the top and bottom of my landscape images? I do not want it there. I specify max width. The system should not make my images the max height.

Link to comment
Share on other sites

If the dimension you choose for your images are not the same "ratio", then PS will resize them, and add a white background.

 

You can either change the original image, or you can change the background color from white to something else (in /images.inc.php)

Link to comment
Share on other sites

If the dimension you choose for your images are not the same "ratio", then PS will resize them, and add a white background.

 

You can either change the original image, or you can change the background color from white to something else (in /images.inc.php)

 

Hi is there no way I can alter the code so that the image handler will resize the image to the max width but keep the aspect ratio?

Link to comment
Share on other sites

That is what the code does now, and that is why you get the white background.

 

What you are asking for is a "Crop" of the image to retain the proper ratio.

You would still want to keep the resize functionality, and add the crop on the resized version.

 

 

You should be able to find some examples of image cropping in PHP, and modify the current resize functions to do a crop.

 

Maybe someone else already implemented it in PS and would share the code, or already did, would be worth doing a search.

Link to comment
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...