steve_c Posted August 12, 2012 Share Posted August 12, 2012 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 More sharing options...
steve_c Posted August 12, 2012 Author Share Posted August 12, 2012 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 More sharing options...
tomerg3 Posted August 12, 2012 Share Posted August 12, 2012 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 More sharing options...
steve_c Posted August 12, 2012 Author Share Posted August 12, 2012 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 More sharing options...
tomerg3 Posted August 12, 2012 Share Posted August 12, 2012 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 More sharing options...
steve_c Posted August 13, 2012 Author Share Posted August 13, 2012 Hi no the shop is adding a white border to the top and bottom of my landscape images as can be seen here. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now