Page 1 of 1

Resizing and croping with GD

Posted: Thu Mar 13, 2008 11:24 pm
by Souljacker
Greetings

I'm coding a MOTIVATIONAL POSTER generator. It's all working ok, but this part.

I want the user to be able to upload any imagem and make it fit the 600x400 screen.

For exemple: if he uploads a image of 1000x500, the script would resize it to 800x400 (the smaller side) and crop 200px from the 800.

Same if the image is smaller then 600x400.

Let's say an 400x300 image. It would resize it to 600x450 then crop 50px from the 450.

The question is how to do it. I can't figure how =/

Re: Resizing and croping with GD

Posted: Fri Mar 14, 2008 12:43 am
by alex.barylski
imagecopy to crop, then imagecopyresized to resize cropped image...