crop an image
- From: ngroups@xxxxxxxxxxx (Merlin)
- Date: Wed, 31 Oct 2007 11:34:12 +0100
Hi there,
I do have a small problem with the proportions of image copy
The image is originally vertical in 100px width and 141px height.
Now I want to crop it to 80 px width and 60px height. There should be no black area and the proportions should be OK. That means that I have to copy only part of the image. In this case it would be 40.5px from above (141-60 / 2 ) and until 100.5 (40.5+60).
This would crop the middle part of the image.
Now with imagecoyresampled I can set the starting point of 40.5px, but not the ending point. The image will have a black bottom.
Here is the code I am using:
imagecopyresampled($outputImg, $inputImg, 0,0, 0 , 40.5, 80, 60, $srcX, $srcY);
Thank you for any hint. Maybe somebody has a good idea on how to crop that image.
Best regards,
Merlin
.
- Follow-Ups:
- Re: [PHP] crop an image
- From: David Christopher Zentgraf
- Re: [PHP] crop an image
- Prev by Date: Re: [PHP] Best way to automatically get mySQL database.
- Next by Date: while-do +array
- Previous by thread: Stopping objects from auto-serializing
- Next by thread: Re: [PHP] crop an image
- Index(es):
Relevant Pages
|