with this fix can save transparent PNG files: replace this c...

Recommend this page to a friend!

      Resize and thumbnail picture  >  All threads  >  with this fix can save transparent...  >  (Un) Subscribe thread alerts  
Subject:with this fix can save transparent...
Summary:Package rating comment
Messages:1
Author:buddax2
Date:2009-02-27 12:31:53
 

buddax2 rated this package as follows:

Utility: Good
Consistency: Not sure
Examples: Good

  1. with this fix can save transparent...   Reply   Report abuse  
buddax2 - 2009-02-27 12:31:53
with this fix can save transparent PNG files:

replace this code in save() function:
//save thumb
if (empty($save)) $save=strtolower("./thumb.".$this->img["format"]);
/* change ImageCreateTrueColor to ImageCreate if your GD not supported ImageCreateTrueColor function*/
$this->img["des"] = ImageCreateTrueColor($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);
@imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"], $this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);

with:

//save thumb
if (empty($save)) $save=strtolower("./thumb.".$this->img["format"]);
/* change ImageCreateTrueColor to ImageCreate if your GD not supported ImageCreateTrueColor function*/
$this->img["des"] = ImageCreateTrueColor($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);
imagealphablending($this->img["des"], false);
@imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"], $this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);
imagesavealpha($this->img["des"], true);

 

For more information send a message to info at phpclasses dot org.