Jump to content

Change Resized Images Background


Recommended Posts

Hi,

Im having some problems, with images on my site. - I have over 500 products to add to my site, and I dont want to upload 6 sizes of the same image.

So I have been using the auto-resize feature.

The Problem I am having is it is adding the original picture, to a white background image, to make up for the extra size.

My site background is Black. Can I change the auto-resize thing somehow so that it adds black background to these images when it resizes?

Link to comment
Share on other sites

  • 7 months later...

Would it be possible to do something like that, but apply only to a particular type of image?

I.e: Categories' picture has a black background whereas the rest have a white one.



Is the name ("thickbox", "home") of the resizing stored in a variable, which I could access from images.inc.php? I have looked arround, but atm don't have time... Would apreciate some help.

Cheers!
Droope

Link to comment
Share on other sites

I think the only way is to use the actually sizes instead of the names. You would have to write something like this in the imageResize function:

if ($destWidth == 600 AND $destHeight == 600)
   $white = imagecolorallocate($destImage, 255, 255, 255);
else
   $white = imagecolorallocate($destImage, 0, 0, 0);

Link to comment
Share on other sites

×
×
  • Create New...