Jump to content

[solved] Product Images background color


majorcode

Recommended Posts

Hello, I am into a situation where I stuck badly. 

I upload an image with the background color of my website and seems fine in product list but when I click on it to make purchase the Image because larger with a different background color.

Product background color is different than frame background color (white), whereas I am trying for frame background color should be same as product back ground color.

 

Anyone has any idea where i change the code so that it takes my background color. Thanks

 

 

Printer.JPG

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

16 hours ago, JBW said:

Depends on your theme and used CSS - used the inpection function of your browser to find the CSS - in 1.7. you can then change its value in your theme's customs.css file

Hello JBW, I am running my shop on 1.6.1.20 and I did use browser inspection to track but all i can figured out is that it give back ground color while generate image size small / large.

Please advise, if there is any script to look for?

Link to comment
Share on other sites

3 hours ago, JBW said:

How is your code for black? Did you regenerate the images?

I did not generate, what i mean that in the code where $white is written, i wrote black to see if it effects any thing but no change,

I want this color #f9f9f9? as background of product picture, please see attached. But the code seems scripted not CSS.

 

 

Printer.JPG.5a2ddebe0c9d7d945d9b00efd33877a7.JPG

Link to comment
Share on other sites

Yes it's scripted in the code mentioned - so you have to replace 255,255,255 by 249,249,249 and regenerate the images. To avoid loosing this code you should do it in an override, not directly in the file

Link to comment
Share on other sites

1 hour ago, JBW said:

Yes it's scripted in the code mentioned - so you have to replace 255,255,255 by 249,249,249 and regenerate the images. To avoid loosing this code you should do it in an override, not directly in the file

Hello JBW, can you advise, how i can do it? for me editing file is easy but how i can replace and regenerate?

Link to comment
Share on other sites

HEX to RGB color: https://www.rapidtables.com/convert/color/hex-to-rgb.html

imagecolorallocate: https://www.php.net/manual/en/function.imagecolorallocate.php

The user wrote it for you @JBW
./classes/ImageManager.php

 

Change:

$white = imagecolorallocate($dest_image, 255, 255, 255);

To:

$white = imagecolorallocate($dest_image, 249, 249, 249);

 

After save, delete class_index.php in ./cache folder

 

Go to admin -> Preferences -> Images

Scroll down "Regenerate thumbnails"

Select an image =  Product

Select a format (not All) = and here the image style changes every time (if you give everything, you will get a script with error 500)

Erase previous images =  Yes (if you do No, the images will not be regenerated)

Click button Regenerate thumbnails

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

13 hours ago, Guest said:

HEX to RGB color: https://www.rapidtables.com/convert/color/hex-to-rgb.html

imagecolorallocate: https://www.php.net/manual/en/function.imagecolorallocate.php

The user wrote it for you @JBW
./classes/ImageManager.php

 

Change:


$white = imagecolorallocate($dest_image, 255, 255, 255);

To:


$white = imagecolorallocate($dest_image, 249, 249, 249);

 

After save, delete class_index.php in ./cache folder

 

Go to admin -> Preferences -> Images

Scroll down "Regenerate thumbnails"

Select an image =  Product

Select a format (not All) = and here the image style changes every time (if you give everything, you will get a script with error 500)

Erase previous images =  Yes (if you do No, the images will not be regenerated)

Click button Regenerate thumbnails

OMG, It is done thank you some much Guest and JBW.

 

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