Figuring out how to use a class with no documentation
| From: | Paul Furman | Date: | Wed, 18 Feb 2004 19:12:10 +0000 |
| Subject: | Figuring out how to use a class with no documentation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-178161@lists.php.net to get a copy of this message | ||
I've found this PEAR module:
http://pear.php.net/package/Image_IPTC
but it has no documentation and I'm a beginner so I am not figuring out how to use this.
There is also a perl module that does the same thing (probably better) but again I have no clue whether I can run it with PHP. I've got perl loaded but don't know how to use it.
Below is some snippage from the code trying to get at how to use it. I've posted the full code here for convenience:
http://www.edgehill.net/IPTC.php.txt
<snippage>
* This class encapsulates the functions iptcparse() and iptcembed(). It provides
* the necessary methods for extracting, modifying, and saving IPTC data with
* image files (JPEG and TIFF files only).
class Image_IPTC
var $_sFilename = null;
var $_aIPTC = array();
* The IPTC fields that were extracted from the image
* or updated by this class.
var $_bIPTCParse = false;
* set to true if the APP header data could be obtained.
iptcparse (places where I saw this)
http://us4.php.net/iptcparse
function Image_IPTC( $sFilename )
$this->_aIPTC = @iptcparse($aAPP['APP13']);
$this->_bIPTCParse = true;
function isValid()
return $this->_bIPTCParse;
function getAllTags()
return $this->_aIPTC;
* An array of IPTC fields as it extracted by iptcparse()
iptcembed (places where I saw this)
http://us4.php.net/iptcembed
one comment refers to the Image::IPTCInfo Perl module
-undocumented, some serious compatibility problems, improper format
function save( $sOutputFile = null )
$sImageData = @iptcembed($sIPTCBlock, $this->_sFilename, 0);
function output()
@iptcembed($sIPTCBlock, $this->_sFilename, 2);
Paul Furman wrote: OK this looks like the thing: http://multipart-mixed.com/photo/iptc.html It's a perl module. Can I use that in PHP?