Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.
function getIPTC($dir, $name, $tag) {
$result = array();
$filename = $dir . "/" . $name . "." . $tag;
getimagesize($filename, $imgsize);
if (! is_array($imgsize))
return $result;
if (! isset($imgsize[ 'APP13' ]))
return $result;
$iptc = iptcparse($imgsize[ 'APP13' ]);
if (! is_array($iptc))
return $result;
$iptcmap = array(
'1#070' => 'DATESENT',
'1#080' => 'TIMESENT',
'2#005' => 'OBJECTNAME',
'2#007' => 'EDITSTATUS',
'2#010' => 'URGENCY',
'2#015' => 'CATEGORY',
'2#020' => 'SUBCATEGORY',
'2#022' => 'FIXTURE',
'2#025' => 'KEYWORD',
'2#030' => 'RELDATE',
'2#035' => 'RELTIME',
'2#040' => 'SPECINSTR',
'2#055' => 'CREDATE',
'2#060' => 'CRETIME',
'2#065' => 'ORGPRG',
'2#070' => 'PRGVER',
'2#080' => 'BYLINE',
'2#085' => 'BYTITLE',
'2#090' => 'CITY',
'2#092' => 'SUBLOCATION',
'2#095' => 'STATE',
'2#100' => 'COUNTRYCODE',
'2#101' => 'COUNTRYNAME',
'2#103' => 'ORGTRANSREF',
'2#105' => 'HEADLINE',
'2#110' => 'CREDIT',
'2#115' => 'SOURCE',
'2#116' => 'COPYRIGHT',
'2#118' => 'CONTACT',
'2#120' => 'CAPTION',
'2#122' => 'CAPTIONWRITER',
'2#130' => 'IMAGETYPE',
'2#131' => 'ORIENTATION',
'2#135' => 'LANGUAGE',
'8#010' => 'SUBFILE',
'2#199' => 'APPRESERVER'
);
foreach ($iptc as $pos => $values)
foreach ($values as $value)
{ if (! isset($iptcmap[ $pos ]))
continue;
// strip leading zeros (weird Kodak Scanner software)
while ($value[ 0 ] == chr(0))
$value = substr($value, 1);
// remove binary nulls
$value = str_replace(chr(0x00), ' ', $value);
if (trim($value) == '')
continue;
if (isset($result[ $iptcmap[ $pos ] ]))
$result[ $iptcmap[ $pos ] ] .= ' ';
else
$result[ $iptcmap[ $pos ] ] = '';
$result[ $iptcmap[ $pos ] ] .= $value;
}
return $result;
}
1 to 8 of 8