Voting reminder: Image_IPTC
| From: | Patrick O'Lone | Date: | Sun, 06 Apr 2003 05:27:42 +0000 |
| Subject: | Voting reminder: Image_IPTC | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-14934@lists.php.net to get a copy of this message | ||
I haven't heard any votes, yeah or nay, to this class, so I've sent out
a reminder. One person has noted that nekonedit uses block 2#021 for
keywords, but Photoshop uses 2#025. I don't which one is right because I
can't find any standards on this - needless to say, the key can be
passed directly for non-Photoshop image clients, like so:
<?php
echo $oIPTC->getTag(021, 0);
// To get all tags, passing a negative number
$aKeywords = $oIPTC->getTag(021, -1);
?>
I might want to make the get all values version of the getTag() method
use a constant instead of a negative number.
ORIGINAL MESSAGE >>>>
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());
?>
I would like to contribute the code under the PHP License. If you have
any questions or need additional information, feel free to contact me.
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