Re: [PROPOSAL] Package 'ImageText'
| From: | Stefan Neufeind | Date: | Fri, 10 Oct 2003 10:50:11 +0000 |
| Subject: | Re: [PROPOSAL] Package 'ImageText' | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22550@lists.php.net to get a copy of this message | ||
On 10 Oct 2003 at 10:43, Tobias Schlitt wrote:
> <zitiere wer="Pierre-Alain Joye">
>
> >> I don't know, what the real purpose of Image_Transform is. Should
> >> this get a general class for image manipulations or (as the
> >> describtion says) a wrapper around several image technologies in
> >> PHP?
>
>
> > Image_Transform provides a lot of common methods using a lot of
> > backends (gd/2, imagick console and ext, netpbm,...). It provides
> > also a simple text function for all backends.
>
> That's what I thought why ImageText should stay alone. It only
> supports GD2 until now and I don't think I'll add support for other
> backends. It's functionality is very GD specific.
I think aiming at GD2 only is okay (for now). But I see too few
common ground to merge it with the aims of Image_Transform. So maybe
Image_GDTools or similar would be an idea?
> > But I do not care that much if you do not use it as I already use my
> > own code for texts alignments ;-)
>
> >> I think a class wrapping and extending the GD2 features has a
> >> strict other goal and could cooperate better with ImageText.
>
> > Create a wrapper around GD2 functions only to provide a OO interface
> > sounds useless to me (to do not say silly ;) ). OO is nice, but
> > well, if you plan to create an interface that does not add anything
> > to the native functions then you only add something to slow down the
> > whole thing.
>
> I fully agree with you about OO! ;=) The idea of my "wrapper class"
> was to add some nice little features like setBackground(), addBoder(),
> etc. for general image handling (to create an image in OO way) and
> things like figure adding (eg. addStar(), addBuble(), or something
> else). This would integrate perfectly with ImageText. I imagine
> something as follows:
>
> $img = new GD2Image(200, 300);
> $img->setBackground(255, 255, 255);
> $img->addBorder(...);
>
> $text = new ImageText("Foo Bar", array("width" => 50, "height"
> =>
> 50)); $text->measurize();
>
> $img->addText($text, 100, 20);
> $img->addStar(...);
>
> What do you think about that?
Sounds a nice idea to me, that surely needs to be worked out further.
But inside this class we could even implement features like "round
broders" or other things that are a bit more difficult to write by
hand for regular PHP-coders.
Stefan