Re: RFI: Image_Resize

From: Date: Tue, 16 Apr 2002 14:23:22 +0000
Subject: Re: RFI: Image_Resize
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5572@lists.php.net to get a copy of this message
The aim was to get one step closer :) - looks like we're getting there.., _parse_size_argument? - long but descriptive... yeah, image_gd -> Image_Resize_GD - good ole typo... -- the idea is to get a base class going - so that there is something to patch against, i guess - image_tranform sounds good. the base structure should 'load' 'save' 'display', all the other stuff can be added as people contribute.. stuff like 'rotate', 'transformMatrix', 'addText', ... any other ideas, can go in later. the base class can just return error 'not supported' etc. if these are not available.... if x=0 then it sends to resizeY -- then if y=0 it will raise an error.. etc. 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 not online at work for another 12hours+ as I'm moving office, and the lines down. so I'll not upto much on it for a while.- catch me on #pear on efnet :) - tommorow best regards alan Peter Bowyer wrote:
Hello Alan, At 11:17 AM 4/16/02 +0800, Alan Knowles wrote:
I think this would be a good next step - rename the class Image_Transform::
Yes.
Ive added percentage '10%' and <1 (0.13) factor scaling, - the resizeX(n) are public methods, although Resize(0,n) sounds like it would be the first choice for alot of developers -I cant see any big issues with leaving resizeX public and having it as an 'added extra' anyway....
Unfortunately the way you have coded this will prevent the imageMagick version from working. I am taking parts of the code and merging them with my version to get it working... will post code this evening, as I've got work to do this afternoon :-( The resizeX and resizeY are the core of the problem actually, so it's these that I'm having to deal with. The way you've written them in the GD version they'll scale the image rather than just resize that one dimension - and of course if the other function is called later then you don't want to continue resizing the images - the sizes need to be stored and the resize called only once. Can you think of a better name for the function _parse_input, as it's not very descriptive? I've tried _parse_size but that's not very nice either. Thanks for adding the error handling - I couldn't work out how the PEAR error stuff was supposed to work :-) When should one use $this->raiseError and when should one use PEAR::raiseError? You've used one in one file and the other in the other file. Regards, 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--


« previous php.pear.dev (#5572) next »