I have the following script that works great for .jpeg files, but once used for .gif the transparency is gone. What is it that I am missing.. I have searched everywhere and I'm going NUTS.
/// test watermark //
$font="$adminpath/register/include/MTCORSVA.TTF";
$text="testing";
$white = imagecolorallocatealpha($source_id, 255, 255, 255, 90);
$color = imagecolorallocatealpha($source_id, 0, 0, 0, 75);
//check width of the text
$bbox=imagettfbbox(20, 0, $font, $text);
$xcorr=0-$bbox[6];
$mase=$bbox[2]+$xcorr;
//check height of the image
$heightnew=imagesy($source_id);
$height=(($heightnew/2)+10);
$heightoffset=($height+1);
//check width of the image
$widthnew=imagesx($source_id);
$width=($widthnew-$mase)/2;
$widthoffset=($width+1);
//calculate x coordinates for text
//$new=($width-$mase)/2;
// Add some shadow to the text
ImageTTFText($source_id, 20, 0, $widthoffset, $heightoffset, $color, $font, $text);
ImageTTFText($source_id, 20, 0, $width, $height, $white, $font, $text);
if ($size[2] == '2'){
ImageJPEG($source_id,"$adminpath/customerimages/" . $renameimage,100);
} else if ($size[2] == '1'){
ImageGIF($source_id,"$adminpath/customerimages/" . $renameimage,100);
}
ImageDestroy($source_id);
///