Jump to content

Image resize with background color problem


bbmak

Recommended Posts

I try to resize an image to thumb with the background white. However, I only can fill half of the background. Anybody know why?

 

$img = imagecreatefromjpeg($target);
$tci = imagecreatetruecolor($w, $h);
imagecopyresampled($tci, $img, 0, 0, 0, 0, $w, $h, $w_orig, $h_orig);
$bg_color = imagecolorallocate ($tci, 255, 255, 255);
imagefill($tci, 0, 0, $bg_color);

 

a sample below. Anybody know why?

post-22483-13482403669325_thumb.jpg

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.