Re: RFI: Image_Resize

From: Date: Mon, 15 Apr 2002 07:18:59 +0000
Subject: Re: RFI: Image_Resize
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5497@lists.php.net to get a copy of this message
$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' :)
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));
actually I saw some code to do it in GD on the php manual comments - by copying the pixels :) - hopefully if the merge of GD into php goes ahead rotation can be added in at source though..
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).
I was looking at the 'Image_Rotate extends Image_Resize' bit, - you would have to make sub classes Image_GD_extra and Image_IM_extra or similar - that extend the based classes - to include the loading stuff... the whole idea of not making this class too big is a little odd though, cause any image manipulation would be high on memory and server load, so adding extra code in is probably not going to make that much difference in comparison (although I could have missed something) - although it makes the documentation thinner.... regards alan
Regards Peter. -- Maple Design - quality web design and programming http://www.mapledesign.co.uk


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