Page 1 of 1

Crop photo

Posted: Wed Feb 27, 2008 9:43 am
by westen
I have a photo that is 200*400. I wish to make it 200*200 by chopping off the bottom of the photo. At present I am attempting to use:

imagecopyresized($canvas, $piece, 0, 0, 0, 0 , $w, $h, $width, $height);

I assumed that I would just put the heights different and this would work but this just squashes it.

I can change where the x and y coords are but this just gives me black stuff around the picture.

Am I using the right function? If anyone can please help me i would very much appreciate it.

Cheers,
Westen

Re: Crop photo

Posted: Wed Feb 27, 2008 9:48 am
by Jade
Are you trying this on a .jpg or a .gif? I found you get the black only on transparent .gifs. You could try changing it to a jpeg.

Re: Crop photo

Posted: Wed Feb 27, 2008 10:09 am
by westen
I am using jpegs.

Regards,
Westen