thumbnails of transparent background gifs
- From: salmobytes <Sandy.Pittendrigh@xxxxxxxxx>
- Date: Thu, 27 Sep 2007 14:34:15 -0000
The following resize stuff does not work for gifs with transparent
backgrounds. What would make it work?
function Create()
{
switch($this->ImageType)
{
case ".gif":
$this->ImageObj =
imagecreatefromgif($this->ImageUrl);
break;
//snip other cases
}
}
function ResizePct($Percent)
{
list($Width, $Height) = getimagesize($this->ImageUrl);
$NewWidth = intval(($Width * $Percent) / 100);
$NewHeight = intval(($Height * $Percent) / 100);
$this->ResizedImage = imagecreatetruecolor($NewWidth,
$NewHeight);
imagecopyresampled($this->ResizedImage, $this-
ImageObj, 0, 0, 0, 0,$NewWidth,
$NewHeight, $Width, $Height);
switch($this->ImageType)
{
case ".gif":
imagegif($this->ResizedImage,$this-
ThumbnailUrl);break;
//snip other cases
}
}
.
- Prev by Date: Re: Site preview with thumb
- Next by Date: Re: Site preview with thumb
- Previous by thread: Site preview with thumb
- Next by thread: php problem with gd library
- Index(es):