ESLION Posted March 5, 2009 Share Posted March 5, 2009 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 More sharing options...
rocky Posted March 6, 2009 Share Posted March 6, 2009 In images.inc.php, search for wherever the function imagecolorallocate is called and change "255, 255, 255" to "0, 0, 0". Link to comment Share on other sites More sharing options...
ESLION Posted March 6, 2009 Author Share Posted March 6, 2009 Thanks works great Link to comment Share on other sites More sharing options...
droope Posted October 29, 2009 Share Posted October 29, 2009 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 More sharing options...
rocky Posted October 29, 2009 Share Posted October 29, 2009 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 More sharing options...
droope Posted October 29, 2009 Share Posted October 29, 2009 Ah yes! Didn't think about that.Thank you very much You rule.CHeers!Droope Link to comment Share on other sites More sharing options...
Recommended Posts