Post by comiclair » Fri Jul 09, 2010 4:20 am

I want to change the background of the product image from white to another color but haven't found it in the forums. So if anyone can direct where to change the color would be great

Thanks

Active Member

Posts

Joined
Sun Jun 07, 2009 5:08 am
Location - Trenton, NJ

Post by JAY6390 » Fri Jul 09, 2010 9:44 am

Go to /system/library/image.php
find this line
$background = imagecolorallocate($this->image, 255, 255, 255);
and replace the 255, 255, 255 with the RGB value of the colour you want

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by comiclair » Fri Jul 09, 2010 10:39 am

thank you

Active Member

Posts

Joined
Sun Jun 07, 2009 5:08 am
Location - Trenton, NJ

Post by JAY6390 » Fri Jul 09, 2010 6:02 pm

No problem :)

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by karinchan » Fri Jul 09, 2010 10:11 pm

how to make the image product transparent?

Newbie

Posts

Joined
Fri Jul 09, 2010 10:01 pm

Post by comiclair » Sat Jul 10, 2010 5:35 am

I changed the color code but it still shows the white in the background a long the sides of the image .


Image

so is there something else I need to change
thanks

Active Member

Posts

Joined
Sun Jun 07, 2009 5:08 am
Location - Trenton, NJ

Post by karinchan » Sat Jul 10, 2010 11:43 pm

I also tried the code but nothing happened..

Newbie

Posts

Joined
Fri Jul 09, 2010 10:01 pm

Post by jayman » Mon Jul 12, 2010 8:15 am

Instead of going the route you are going try just changing the image setting in your admin. Your images are rectangles and your site is making them squares. If you go into you admin and go to "system" then go to "settings" and click on the image tab you can adjust your sites default images dimensions.

By default opencart make your
Product Image Thumb Size 250x250
Product Image Popup Size 500x500
Category List Size 120x120
Product List Size 120x120
Additional Product Image Size 150x150
Related Product Image Size 120x120
Cart Image Size 75x75


So if your image you want for your site is 250x500 this is what I would set my images to.

Product Image Thumb Size 125x250
Product Image Popup Size 250x500
Category List Size 60x120
Product List Size 60x120
Additional Product Image Size 75x150
Related Product Image Size 60x120
Cart Image Size 37x75


You will have to tweak the numbers to find what works for your images, but that will eliminate those lines on either side of your images.

New member

Posts

Joined
Wed Apr 07, 2010 1:32 pm

Post by comiclair » Mon Jul 12, 2010 11:27 am

the changing the color does work but only when you add new product with pictures. The older product listed would have to have the images uploaded again. So you don't have to mess with size of the pictures.

Chad

Active Member

Posts

Joined
Sun Jun 07, 2009 5:08 am
Location - Trenton, NJ

Post by jokensigns » Mon Jan 18, 2016 9:16 pm

I too can't seem to get this working. I created a new product just in case it wouldn't use existing. I cleared the image cache, reloaded the site several times. And the color hasn't changed? I'm using a PNG file and the background is still the default white?

Using OC 2.1.0.1

Ken

Newbie

Posts

Joined
Mon Feb 04, 2013 8:24 pm

Post by FunkyUserName » Mon Mar 14, 2016 4:37 pm

best method as far as i see it is to go to the stylesheet.css and add this:
.thumbnail {
background-color: #FFD0F9;
}

Newbie

Posts

Joined
Sun Mar 13, 2016 6:18 am
Who is online

Users browsing this forum: No registered users and 5 guests