Class Image_IPTC

Description

An abstraction layer for working with IPTC fields

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).

Located in /lib/core/Parsers/IPTC.php (line 32)


	
			
Method Summary
Image_IPTC Image_IPTC (string $sFilename)
array getAllTags ()
mixed getTag (mixed $xTag, [integer $nBlock = 0])
boolean isValid ()
void output ()
boolean save ([string $sOutputFile = null])
void setTag (mixed $xTag, mixed $xValue, [integer $nBlock = 0])
Methods
Constructor Image_IPTC (line 69)

Constructor

  • access: public
Image_IPTC Image_IPTC (string $sFilename)
  • string $sFilename: The name of the image file to access and extract IPTC information from.
getAllTags (line 185)

Get a copy of all IPTC tags extracted from the image

  • return: An array of IPTC fields as it extracted by the iptcparse() function
  • access: public
array getAllTags ()
getTag (line 156)

Get a specific tag/block from the IPTC fields

  • return: If the requested tag exists, a scalar value will be returned. If the block is negative, the entire
  • see: _lookupTag()
  • access: public
mixed getTag (mixed $xTag, [integer $nBlock = 0])
  • mixed $xTag: The tag name (by number or string) to access. For a list of possible string values look at the _lookupTag() method.
  • integer $nBlock: The block to reference. Most fields only have one block (the 0th block), but others, like the "keywords" block, are an array. If you want to get the whole array, set this to a negative number like -1.
isValid (line 98)

Returns the status of IPTC parsing during instantiation

You'll normally want to call this method before trying to change or get IPTC fields.

  • return: Returns true if the getimagesize() function successfully extracted APP information from the supplied file
  • access: public
boolean isValid ()
output (line 230)

Embed IPTC data block and output to standard output

  • access: public
void output ()
save (line 201)

Save the IPTC block to an image file

  • access: public
boolean save ([string $sOutputFile = null])
  • string $sOutputFile: If supplied, the altered IPTC block and image data will be saved to another file instead of the same file.
setTag (line 122)

Set IPTC fields to a specific value or values

  • access: public
void setTag (mixed $xTag, mixed $xValue, [integer $nBlock = 0])
  • mixed $xTag: The field (by number or string) of the IPTC data you wish to update
  • mixed $xValue: If the value supplied is scalar, then the block assigned will be set to the given value. If the value supplied is an array, then the entire tag will be given the value of the array.
  • integer $nBlock: The block to update. Most tags only use the 0th block, but certain tags, like the "keywords" tag, use a list of values. If set to a negative value, the entire tag block will be replaced by the value of the second parameter.

Documentation generated on Sun, 06 Mar 2011 00:24:16 -0500 by phpDocumentor 1.4.3