Re: [PROPOSAL] Package 'ImageText'
| From: | Stefan Neufeind | Date: | Fri, 10 Oct 2003 22:03:40 +0000 |
| Subject: | Re: [PROPOSAL] Package 'ImageText' | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22574@lists.php.net to get a copy of this message | ||
On 10 Oct 2003 at 13:10, Tobias Schlitt wrote:
> <zitiere wer="Stefan Neufeind">
>
> >> > 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?
>
> That's what I thought about. I don't know, if the name is so nice, but
> indeed, that's the package I thought about.
>
> Another issue is, if it's suitable to package ImageText into that GD2
> package or to leave it an independent package at first, which will
> depend on that GD2 package later, when that's ready? The second
> solution sounds better to me and I would be able to release ImageText
> in a first version right now.
>
> >> > 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.
>
> Right, that'd be the intension of the package. To implement often used
> graphix features.
In this point I must support Pierre:
Thinking about the consequences and possibilites a bit further and
following the discusssion I'm also against releasing it as ImageText
because it would surely be best to later move it into the GD-util-
package (whatever it will be called). Maybe you could sketch a GD-
tool-package, implement some small but useful functions and for the
time being mostly concentrate on the Text-part? In my oppinion it
would be okay to first start with the text-part of the package and do
a first 0.1 or whatever ... but since we want to keep the number of
packages small and try to never drop packages altogether (because
they are completely integrated in another) we should consider aiming
at the "big" GD-util-package already!
Stefan