Re: skewed up images

From: Date: Sat, 16 Jul 2005 13:33:04 +0000
Subject: Re: skewed up images
Groups: php.general 
Request: Send a blank email to php-general+get-218808@lists.php.net to get a copy of this message
Thanks mate, works perfectly now. -Ryan On 7/16/2005 4:49:30 AM, Richard Davey (rich@launchcode.co.uk) wrote: > 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 > > -- >

« previous php.general (#218808) next »