Jump to content

[SOLVED] Prestashop image cropping background, change white color


Kerm
 Share

Recommended Posts

Hello, can some one help me please.

 

I need change image cropping default white background on other color, like black, how and where i can do it in prestashop 1.4??

post-231092-0-51534400-1376911628_thumb.jpg

Share this post


Link to post
Share on other sites

you have to change the height of the image under the preferences > images

image size defined there must be proportional to the sizes of the image that you're trying to upload

 

you can also change the image extension type (the same back office menu as above)

c3RBfaF.png

 

 

then all images will have transparent background

Share this post


Link to post
Share on other sites

Hello, thx for reply!

 

I already found the answer, need change in file images.inc.php function "imageCut", find this:

 

$white = imagecolorallocate($dest['ressource'], 255, 255, 255);

 

And change on this:

 

$white = imagecolorallocate($dest['ressource'], 42, 42, 42);

 

Where 42, 42, 42 is RGP color

 

PS.: I have in my shop product images with different aspect ratios so some images will be cropped anyway...

PS2.: I strongly recommend do not use option "Use PNG for all images", especially if u have alot product images, becose disk usage will increase up to 10 times...also same customers may experience difficulties when downloading these images with weak internet..

Edited by Kerm (see edit history)

Share this post


Link to post
Share on other sites

thanks for information that you sloved it and for valuable tips that you mentioned

it will be really helpfull for other merchants here

 

im going to mark this topic as [sOLVED]

 

best regards

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
 Share

×
×
  • Create New...

Important Information

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