Jump to content

how can i change the background colour of the product images?


Recommended Posts

I understand exactly what you guys are saying.

I really think prestashop needs to strip out the automatic resizing/image processing.

It absolutely sucks. It's really counter intuitive for designers. I'm struggling with the same problem. I have my thumbnails the exact size I want them, but prestashop scales them, then re-scales them on my product pages, and its absolutely mind blowing how horrible this is.

Here is a link to my development shop so you can see how I'm having image/color problems as well.

http://97.74.74.236/~visua/category.php?id_category=8

Link to comment
Share on other sites

Let's hope so.

I've tried to overwrite the files located in img/p by locating the generated thumbnail file, and manually uploading the correct image (this would be tedious and a real problem if it even worked). But it doesn't. It seems prestashop has 'locked' write access to these folders. I've tried to chmod them and recursively change permissions to no avail.

I think a much more 'flexible' system, would to allow users to upload as many images they want, without cropping and resizing. Why does anyone need this feature in the first place? Honestly, most people designing shops have photoshop already, and would like more control over their images anyway. I feel i should be able to upload a thumbnail, and a separate product image for the detail page. Oh, and the files should be uploaded *AS IS*. I don't trust your code to make my files look better.

The resize/crop should just be an added feature option for people who are probably using the standard theme or configuration anyway.

This just really sucks guys. I'm going to have to abandon all the work i've done on this site if this is not doable. I simply cannot sacrifice product images and branding because the software won't let us use our own images.

UPDATE:

You can change the thumbnail size by going to Preferences > Images and changing the 'home' values to the width and height of your pre-prepared images.

This does not however, solve the problem of having different images for the product detail page!

Link to comment
Share on other sites

Maybe this will work. I did not try it.
Find global.css in your template folder and look for the following code.

center_column div.products_block a.product_image {
   display: block;
   background-color: transparent;
   width: 129px;
   height: 129px;
   margin-left:2px;
}



Change the background-color to any color you want.

Jack

Link to comment
Share on other sites

jnktaylor,

The problem with this, is that no matter what the files are converted to .jpg's. So even if i upload a png file with transparency, it will resize and automatically render a white background since JPG does not support transparency.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Solution for changing the background color on product images:

Find this line in images.inc.php on line 155:

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



Change to: (xxx = rgb color codes)

$white = imagecolorallocate($destImage, xxx, xxx, xxx);



Now you have to regenerate all the images in Preferences/image/

Be aware that if you have manually edited any images, they will now be overwritten. Be sure to backup your files.

Good luck!


Kind regards
Kyrre

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

In 1.5.3 this line is not there. You will need to amend ps\class\imagemanager. Line 375 and posibly near line 170.  There I noticed that if the uploaded image is a png the extra background will be set to transparent, otherwise it will be white. I will now upload all my images as png. That way I will not need to change above mentioned file and will stay compatible if I need to upgrade in future.

Have tested png upload and it works!

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