I have a script-sized image that takes a 130x81 image and adds it to a 130x130 image, when the imagecopyresampled function runs it, it adds a black background to the remaining space, although the base image is white. Code below, I could really appreciate some help.
The image that I am trying to combine into the created php 130x130 is: 
$width = 130; $height = 130; $filename = 'process-add.jpg'; //130x81px jpg $this->_image = imagecreatefromjpeg($filename); $background = imagecreatetruecolor(130,130);//create the background 130x130 $whiteBackground = imagecolorallocate($background, 255, 255, 255); imagefill($background,0,0,$whiteBackground); // fill the background with white imagecopyresampled($background, $this->_image,(130-$width)/2,(130-$height)/2, 0, 0, $width, $height, $width, $height); // copy the image to the background ImageJpeg ($background,null,100); //display
I read a few posts to add:
imagealphablending($background, false);
into code that should fix it, but that doesn't make any difference.
Thanks in advance!
php resize gd
Scott
source share