php imagecopyresampled ajoute arrière-plan noir

J'ai un redimensionnement de l'image de script qui prend un 130x81 image et l'ajoute à un 130x130 l'image, quand la imagecopyresampled fonction s'exécute, il ajoute un fond noir dans l'espace qui reste, même si l'image de base est le blanc. Le Code ci-dessous, j'ai pu vraiment apprécier un peu d'aide.

L'image que je suis en train de fusionner sur la 130x130 fichier php est créé:
php imagecopyresampled ajoute arrière-plan noir

$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

J'ai lu sur plusieurs postes d'ajouter:

imagealphablending($background, false);

dans le code qui devrait corriger le problème, mais il ne fait aucune différence.

Merci d'avance!

OriginalL'auteur Scott | 2013-07-16