When i cr开发者_如何学Copped a png image using php gd library it cropped in a strange way. As it is partially cropped. I think the transparency is not working properly.
Here is my code
imagesavealpha($this->image, true); $bg = imagecolorallocatealpha($this->image, 0, 0, 0, 127); imagefill($this->image, 0, 0, $bg); imagepng($this->image,$filename);
Sounds like you like you are giving your new image the wrong size.
How do you crop the image? imagecopyresampled
?
http://php.net/manual/en/function.imagecopyresampled.php
精彩评论