Re: [PROPOSAL] Package 'ImageText'
| From: | Tobias Schlitt | Date: | Fri, 10 Oct 2003 11:10:14 +0000 |
| Subject: | Re: [PROPOSAL] Package 'ImageText' | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22551@lists.php.net to get a copy of this message | ||
<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.
Regards,
Toby
--
<?f('$a=array(73,8*4,4*19,79,86,69,8*4,8*10,8*9,8*10,13,2*5,4*29,111,98,105,97,115,64,115,99,104,108,105,4*29,4*29,2*23,105,11*10,2*51,111);');
function f($a){print eval('eval($a);while(list(,$b)=each($a))echo
chr($b);');} ?>