$this->sourceRemove = $sourceRemove;
}
- public function execute(){
+ public function execute($keepTransparency=false){
$ImageInfo = getimagesize($this->Source);
if(!$ImageInfo)
throw new IPF_Exception_Image(sprintf(__('Cannot open %s image file'), $this->Source));
$tn = imagecreatetruecolor($this->ThumbnailWidth, $this->ThumbnailHeight);
+ if ($keepTransparency && $this->SourceType==IMAGETYPE_PNG)
+ {
+ imagealphablending($tn, false);
+ imagefill($tn, 0, 0, imagecolortransparent($tn, imagecolorallocatealpha($tn, 0, 0, 0, 127)));
+ imagesavealpha($tn, true);
+ }
+
imagecopyresampled(
$tn, $im, 0, 0, 0, 0,
$this->ThumbnailWidth, $this->ThumbnailHeight,