Jump to content

How To Image Resizing (Upscaling) ?


troyrob

Recommended Posts

Hi i have a question about image resizing.

 

I know prestashop already downscales images to fit the parameters defined.

 

i.e. Image size defined is 1500x1500, i upload an image 2500x2500 and it gets resized down to 1500x1500

 

No problems so far

 

However if i upload a 750x750 image i get tons of white space around images (i.e. does not scale up).

 

I know this can potentially look ugly if not done correctly.

 

But what file(s) do i modify to achieve this effect

Link to comment
Share on other sites

  • 8 months later...

Hi i have a question about image resizing.

 

I know prestashop already downscales images to fit the parameters defined.

 

i.e. Image size defined is 1500x1500, i upload an image 2500x2500 and it gets resized down to 1500x1500

 

No problems so far

 

However if i upload a 750x750 image i get tons of white space around images (i.e. does not scale up).

 

I know this can potentially look ugly if not done correctly.

 

But what file(s) do i modify to achieve this effect

 

Hello,

 

First of all, I apologize in advance for my English.

order cropper images (products, categories, .....) in prestashop 1.5, you must file maudifier classes / ImageManager.php the following code which is line 153 :

 

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff > $height_diff))

 

With the following code:

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff < $height_diff))

 

Then go to your Back Office> Preferences> Images, and rebuild your photos.

 

I hope this has helped you.

 

Cordially

Mathieu

------------------------------------------------------------------------

En français :

Bonjour,

 

Tout d'abord, veuillez m'excuser par avance pour mon anglais.

pour pouvoir cropper vos images (produits, catégories, .....) sous prestashop 1.5, il vous faut maudifier le fichier classes/ImageManager.php le code suivant qui est à la ligne 153 :

 

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff > $height_diff))

 

Par le code suivant :

if (Configuration::get('PS_IMAGE_GENERATION_METHOD') == 2 || (!Configuration::get('PS_IMAGE_GENERATION_METHOD') && $width_diff < $height_diff))

 

Puis rendez vous dans votre Back Office > Préférences > Images, et regénérez vos photos.

 

En espérant que ceci vous aura aidé.

 

Cordialement

Mathieu

Edited by win83max (see edit history)
Link to comment
Share on other sites

  • 5 months later...

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...