1
1.4 final / Re: bug with link an oblect
« on: June 13, 2009, 10:09:34 am »
The problem is there only when trying to link a web link. All the other types works properly
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if($this->getImageType() == IMAGETYPE_GIF) {
$new_resource = imagecreate($new_width, $new_height);
} else {
$new_resource = imagecreatetruecolor($new_width, $new_height);
} // if
imagecopyresampled($new_resource, $this->resource, 0, 0, 0, 0, $new_width, $new_height, $this->getWidth(), $this->getHeight());
if($this->getImageType() == IMAGETYPE_GIF) {
$new_resource = imagecreate($new_width, $new_height);
$originaltransparentcolor = imagecolortransparent( $this->resource );
if(
$originaltransparentcolor >= 0 // -1 for opaque image
&& $originaltransparentcolor < imagecolorstotal( $this->resource )
// for animated GIF, imagecolortransparent will return a color index larger
// than total colors, in this case the image is treated as opaque ( actually
// it is opaque )
) {
$transparentcolor = imagecolorsforindex( $this->resource, $originaltransparentcolor );
$newtransparentcolor = imagecolorallocate($new_resource,$transparentcolor['red'],$transparentcolor['green'],
$transparentcolor['blue']);
// for true color image, we must fill the background manually
imagefill( $new_resource, 0, 0, $newtransparentcolor );
// assign the transparent color in the thumbnail image
imagecolortransparent( $new_resource, $newtransparentcolor );
}
} else {
$new_resource = imagecreatetruecolor($new_width, $new_height);
imagealphablending($new_resource, false);
imagesavealpha($new_resource, true);
} // if
imagecopyresampled($new_resource, $this->resource, 0, 0, 0, 0, $new_width, $new_height, $this->getWidth(), $this->getHeight());