Re: RFI: Image_Resize
| From: | Peter Bowyer | Date: | Tue, 14 May 2002 06:40:48 +0000 |
| Subject: | Re: RFI: Image_Resize | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6075@lists.php.net to get a copy of this message | ||
Hi,
Just to let you know that things are still progressing, but very slowly due to two problems:
a) lack of time
b) my host's installation of ImageMagick is broken so I cannot test my modifications
At 01:35 PM 4/22/02 +0800, Alan Knowles wrote:
had a quick look through, the $image->ResizeX etc. Actually what I was aiming for in ResizeX & resizeY was probably closer to $image->scaleMaximumX($number | $factor) $image->scaleMaximumY($number | $factor) as resize in this context means more scale to exactly x and/or y and leave the other one alone if '0' and scale refers to a general resizeing proportionally. the other one was (not that I need it at present) $image->scaleInsideBox($x,$y); - to scale the image down so it fits inside a box of maximum $x and $y.. and I guess an option to say $image->setBorder($width, $color | default= NULL) - so that if it was scaled to fit a box, - if border color = '0' (and not '#000000') then there would be no border - if $border != 0 then it would have a border to fit the box + the border width - or similar.....These are good ideas. I also want to add an addDropShadow command :-)
I guess the need for defines is pretty silly as there is never going to be a performance issue with this library - it's never going to be in the top 10 fastest libraries :) so $image->setOption('IM_lib_dir','/home/me/bin/'); is probably the best way to set the local config.No, I think I'm going to go for a define('IMAGE_TRANSFORM_LIB_PATH', '/usr/local/netpbm'); // or whatever to make it cleaner. It also means we can cut out setting the lib path for scripts that don't need it such as the GD library version.
I also found that there was no way to easy detect GD2 - so ImageCreateTrueColor or ImageCreate would have to be done on a manual SetOption as well.. - $image->setOption('GD_version',1); // default is 2?Given that by the time this code is finished 4.3 should be nearly ready and be coming bundled with GD, I think we can ignore GD 1.X and just build for version 2. Or duplicate the driver and make a 1.X and a 2.X version?
the only other stuff is nitpicking on the Pear standards - the code I think should have spaces rather than tabsFixed Regards Peter ---oOo--- sendcard - The free PHP e-card solution http://www.sendcard.org