Re: RFI: Image_Resize

From: Date: Tue, 16 Apr 2002 03:17:27 +0000
Subject: Re: RFI: Image_Resize
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5539@lists.php.net to get a copy of this message
I think this would be a good next step - rename the class Image_Transform:: -- and look at adding the matrix abilities later. - although they would probably have to be done at the pixel level in php unless any of the libraries support this. attached is a semi-Pearified version of Image_resize.php and Image_Resize_GD.php, havent had time to look at the _IM... 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.... it does a bit more error checking etc. - It would be good to start getting this into PEAR, so that there is a base to start working on - even if it changes a little :) regards alan Bertrand Mansion wrote:
le 15/04/02 9:18, Alan Knowles à alan@akbkhome.com a écrit :
$img->ResizeY(1024);
I quite like this as its very descriptive on what action is about to be taken. - dont really mind eather way though..
I prefer just to have one resize command rather one for each dimension. The class should accept null for a distance, and if that's given default to the original image size: $im->resize(null, 1024);
the other option is just to use 0 - to indicate ignore, as if you sent 0 anyway it would be a 'stupid thing to do' :)
IMHO, the most interesting thing to do in image manipulation domain is to use a Transformation Matrix as it is explained here : http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/Programmin gTopics/DrawBasic/Concepts/transforms.html You just fill a Matrix (a multidimensional array or a dedicated object) and send it to your image class. This will return the modified image. Other implementation seems too heavy, too limited or too simple. Bertrand Mansion Mamasam


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