|
Posted by Richard Davey on 10/21/70 11:21
Hello Ryan,
Saturday, July 16, 2005, 3:53:16 AM, you wrote:
RA> in the beginning if the height is more, then its resizing
RA> perfectly...but if the width is more I want to cut out 90pix from
RA> the middle of the pic...instead its giving me a skewed image as
RA> you can see from
RA> Any ideas? I know I screwed up somewhere in the function...but just cant
RA> figure it out...
If the width is greater than the height you're calling CR_make_crop
which has this line:
imagecopyresized ($new, $img, 0, 0, 0, 0, 90,120,$width_orig2,$height_orig2);
The problem is that what you're effectively saying is:
Copy the entire original picture (0,0 to $width_orig2, $height_orig2)
into an area 90x120, and resize it when you do it.
That's not a crop :) That's a resize. You'd be better off with a
function like imagecopy() instead - once you have that 90x120 cropped
piece, then you can do whatever it is you wanted to do with it.
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov
Navigation:
[Reply to this message]
|