Constructor
Image_IPTC
Image_IPTC
(string $sFilename)
-
string
$sFilename: The name of the image file to access and extract IPTC information from.
Get a copy of all IPTC tags extracted from the image
array
getAllTags
()
Get a specific tag/block from the IPTC fields
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.
Returns the status of IPTC parsing during instantiation
You'll normally want to call this method before trying to change or get IPTC fields.
boolean
isValid
()
Embed IPTC data block and output to standard output
void
output
()
Save the IPTC block to an image file
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.
Set IPTC fields to a specific value or values
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.