gd - PHP imagecolorallocate not working -
i running site off of bluehost, php 5.4
, , gd version bundled (2.0.34 compatible)
- high enough gd use imagecreatetruecolor()
i cropping image, , cropped image not entirely fill output thumb. imagecreatetruecolor()
leaves black background wherever resampled image isn't covering output thumb, shown below
but white, or transparent background.
php:
$tci = imagecreatetruecolor($w, $h); $color = imagecolorallocate($tci, 255, 255, 255); imagefill($tci, 0, 0, $color); imagecopyresampled($tci, $img, 0, 0, $x, $y, $w, $h, $wor, $hor); imagejpeg($tci, $preview, $qual);
i not having issue resampling image, or using imagecreatetruecolor()
, whatever reason, cannot background color white.
thank in advance.
edit
if comment out line
imagecopyresampled(...)
then gives correct background color set in imagecolorallocate
, image fill
. it's imagecopyresampled
that's causing problem.
Comments
Post a Comment