Re: Need 1 more vote for Image_IPTC class

From: Date: Tue, 08 Apr 2003 08:15:27 +0000
Subject: Re: Need 1 more vote for Image_IPTC class
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15016@lists.php.net to get a copy of this message
It looks to me like some of this stuff really should simply be part of PHP's native iptc code. Your 31 define() calls at the beginning of your code is just about the slowest thing you could possibly do in user-space PHP and will make it impossible for performance-conscious people to use your code. Putting these right into PHP will let them be done just once on MINIT. We also need to be careful that we don't wrap low-level php functions just for the sake of wrapping them in a more familiar OO interface in PEAR. Not that this is a case of that as there is some genuinely good functionality. -Rasmus On Mon, 7 Apr 2003, Patrick O'Lone wrote: > I would like to (also) contribute an IPTC parsing class that abstracts > the iptcparse() and iptcembed() functions. The class's source can be > viewed at: > > http://www.townnews.com/contrib/IPTC.html > > The class abstracts the retrieving and setting of IPTC field tags. It > supports multi-tagged values, such as those found in the 'keywords' > section of an IPTC header. The class basically works like this: > > <?php > > $oIPTC =& new Image_IPTC("test.jpg"); > > echo "The original caption was: "; > echo $oIPTC->getTag(IMAGE_IPTC_CAPTION); > echo "<br />"; > > $oIPTC->setTag(IMAGE_IPTC_CAPTION, "An example caption."); > $oIPTC->setTag(IMAGE_IPTC_KEYWORDS, "Keyword 1", 0); > $oIPTC->setTag(IMAGE_IPTC_KEYWORDS, "Keyword 2", 1); > $oIPTC->save("output.jpg"); > > print_r($oIPTC->getAllTags()); > > ?> > > If you have questions, comments, or suggestions about the aforementioned > message, you can respond by replying to this message or contacting us at > (309)-743-0800. Thank you. > > Regards, > > Patrick O'Lone > Internet Software Engineer > TownNews.com > > (309)-743-0809 > polone@townnews.com > > >

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