Re: RFI: Image_Resize
| From: | Peter Bowyer | Date: | Wed, 17 Apr 2002 12:53:42 +0000 |
| Subject: | Re: RFI: Image_Resize | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5605@lists.php.net to get a copy of this message | ||
Hi,
At 10:23 PM 4/16/02 +0800, Alan Knowles wrote:
The aim was to get one step closer :) - looks like we're getting there.., _parse_size_argument? - long but descriptive...Too long :-) Have left it as _parse_size() for the time being.
yeah, image_gd -> Image_Resize_GD - good ole typo...or Image_Transform_GD as it now is :-)
stuff like 'rotate', 'transformMatrix', 'addText', ... any other ideas, can go in later.Agreed. Rotate is already in the ImageMagick class, but unfortunately the user contributed function for GD in the PHP manual only rotated through 90 degrees. Anyone fancy the challenge of writing one to rotate it through n degrees?
the base class can just return error 'not supported' etc. if these are not available....Yes, although when I started writing this script I was making it be cross-library compatible to make it easier to distribute my scripts, so having the actions fail with some libraries would be a pain - and we'd need to return silent errors as well IMO, not visible ones.
if x=0 then it sends to resizeY -- then if y=0 it will raise an error.. etc.The reason I don't like the resizeX/resizeY functions is that they are ambiguous. To you they mean: (original image: 640x480) $im->resizeX(30); (image is now 30x480) And in the present code if after the above example I now do: $im->resizeY('80%'); (Image is now 640x384) To me it means that you have to call both resizeX and resizeY before anything happens - these functions merely set the new parameters: $im->resizeX(30); (Image doesn't resize...) $im->resizeY('80%); (.. but now it does, as both sizes are set) I'd like the feedback of other list members, but in my opinion we would be better off leaving these out. To implement your way would be easy but IMO would confuse a lot of people; to do it my way adds unnecessary complication, and only duplicates $im->resize(x, y);.
it's a bit late now to look at the IM stuff - If you get a chance to post it tommorow morning, it'll be interesting to see what youve done.I'm running a bit behind with it but will post this evening or tomorrow. Once the exams have gone I'll have much more free time :-) Best wishes, Peter. --oOo-- Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Glenbranter - Scottish narrow gauge in 009 http://glenbranter.narrow-gauge.co.uk --oOo--