diff --git a/Adapter/GD.php b/Adapter/GD.php index b0fcac7..a088985 100644 --- a/Adapter/GD.php +++ b/Adapter/GD.php @@ -102,7 +102,10 @@ public function crop($x, $y, $width, $height) $destination = imagecreatetruecolor($width, $height); imagealphablending($destination, false); imagesavealpha($destination, true); - imagecopy($destination, $this->resource, 0, 0, $x, $y, $this->width(), $this->height()); + // keep transparency + // http://stackoverflow.com/questions/279236/how-do-i-resize-pngs-with-transparency-in-php +// imagecopy($destination, $this->resource, 0, 0, $x, $y, $this->width(), $this->height()); + imagecopyresampled($destination, $this->resource, 0, 0, $x, $y, $this->width(), $this->height(), $this->width(), $this->height()); imagedestroy($this->resource); $this->resource = $destination;