majorcode Posted April 18, 2020 Share Posted April 18, 2020 (edited) 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 Edited April 26, 2020 by majorcode (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted April 20, 2020 Share Posted April 20, 2020 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 Link to comment Share on other sites More sharing options...
majorcode Posted April 20, 2020 Author Share Posted April 20, 2020 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 More sharing options...
JBW Posted April 21, 2020 Share Posted April 21, 2020 For the generated background color you need to create a override for /classes/ImageManager.php and relace the color code for $white 1 Link to comment Share on other sites More sharing options...
majorcode Posted April 21, 2020 Author Share Posted April 21, 2020 11 hours ago, JBW said: For the generated background color you need to create a override for /classes/ImageManager.php and relace the color code for $white Thank you JBW, How I can paste the following color #f9f9f9? Link to comment Share on other sites More sharing options...
majorcode Posted April 21, 2020 Author Share Posted April 21, 2020 and I just checked that my products images are in JPG, do have to upload PNG format to get it work, because I changed the color black but it does not change any thing. Link to comment Share on other sites More sharing options...
JBW Posted April 21, 2020 Share Posted April 21, 2020 How is your code for black? Did you regenerate the images? Link to comment Share on other sites More sharing options...
majorcode Posted April 21, 2020 Author Share Posted April 21, 2020 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. Link to comment Share on other sites More sharing options...
JBW Posted April 22, 2020 Share Posted April 22, 2020 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 More sharing options...
majorcode Posted April 22, 2020 Author Share Posted April 22, 2020 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 More sharing options...
Guest Posted April 22, 2020 Share Posted April 22, 2020 (edited) 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 April 22, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
majorcode Posted April 23, 2020 Author Share Posted April 23, 2020 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 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