do {
$this->image->cropImage($w, $h, $x, $y);
/*
- * We need to remove the canva,
+ * We need to remove the canvas,
* or the image is not resized to the crop:
* http://php.net/manual/en/imagick.cropimage.php#97232
*/
$dest = imagecreatetruecolor($max, $max);
imagealphablending($dest, false);
imagesavealpha($dest, true);
+
if ($this->type=='image/png') {
imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
}