mantas393 Posted March 1, 2019 Share Posted March 1, 2019 (edited) 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 March 1, 2019 by mantas393 More info (see edit history) Link to comment Share on other sites More sharing options...
Daresh Posted March 1, 2019 Share Posted March 1, 2019 Check out the Perfect Thumbnails module, but it does an auto crop according to the settings, it's not a manual tool. Link to comment Share on other sites More sharing options...
mantas393 Posted March 1, 2019 Author Share Posted March 1, 2019 Hi @Daresh, thanks for reply, I want all my product images to be 400x100. No smaller, no bigger, resized as much as possible and the cropped. Would this module let me to do this? Link to comment Share on other sites More sharing options...
mantas393 Posted March 1, 2019 Author Share Posted March 1, 2019 Or maybe somebody done this by code? Link to comment Share on other sites More sharing options...
Daresh Posted March 1, 2019 Share Posted March 1, 2019 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. Link to comment Share on other sites More sharing options...
mantas393 Posted March 1, 2019 Author Share Posted March 1, 2019 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. Link to comment Share on other sites More sharing options...
Daresh Posted March 1, 2019 Share Posted March 1, 2019 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. 1 Link to comment Share on other sites More sharing options...
mantas393 Posted March 1, 2019 Author Share Posted March 1, 2019 @Daresh, so I bought the module and yes, It does exactly, what I asked:) Thanks for the reply:) Also it's pretty easy to use. 1 Link to comment Share on other sites More sharing options...
Daresh Posted March 1, 2019 Share Posted March 1, 2019 @mantas393 thanks a lot! I would be gratefull if you give the module a rating 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