Re: RFI: Image_Resize
| From: | Peter Bowyer | Date: | Mon, 15 Apr 2002 06:45:51 +0000 |
| Subject: | Re: RFI: Image_Resize | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-5496@lists.php.net to get a copy of this message | ||
Hi Alan,
At 02:35 PM 4/15/02 +0800, Alan Knowles wrote:
started playing with this - probably will continue today - I've got 2 projects + phpmole that needs this stuff.... I suggest moving the resize calculations stuff to the Image_Resize class, as its generic on all classesI have planned to do this but never got round to it :-) As it will be an internal function should it use the under_score naming? IIRC, sC is only for public methods...
also passing an option array to the startup eg. (is that a pear standard - or is it just used alot)... $img =Image_Resize::start(array( 'image_lib'=>'IM', 'IM_path'=>'/home/me/bin/imagick/' ));What do others think? Is this a better way of doing it?
$img->ResizeY(1024);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); What do you think of that? Null isn't a very descriptive word, but I can't think what else could be used.
It would be nice/easy to add rotate, but that kind of ruins the name of the class :)I know - but GD doesn't support rotation, which is a pain. Basic text annotation tools may be useful as well: $im->addText(array('string' => 'This is text', 'x' => 100, 'y' => 100, 'font' => 'Verdana', size => 14)); But then of course this really does mean that the package needs another name, and text addition may complicate things for ImageMagick if it doesn't use the convert library (haven't looked into it yet). Regards Peter. -- Maple Design - quality web design and programming http://www.mapledesign.co.uk