-1

When i cropped 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);
JochenJung
  • 7,183
  • 12
  • 64
  • 113
Shahid Karimi
  • 4,096
  • 17
  • 62
  • 104
  • 1
    The other thing you're supposed to do on Stack Overflow is maintain a professional decorum. Try describing your problem in *words*, rather than a picture. The better you can do that, the more the community will trust you, and the more privileges you will gain. Besides that, this isn't even a real question: it's impossible to tell what's being asked here. – Cody Gray - on strike Jan 19 '11 at 14:09
  • A little less profanity and a little more description of what's going on will do wonders... – Matt Gibson Jan 19 '11 at 15:44

1 Answers1

1

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

JochenJung
  • 7,183
  • 12
  • 64
  • 113