- Timestamp:
- Nov 20, 2004, 7:07:51 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_metadata.inc.php
r593 r611 51 51 foreach (array_keys($rmap) as $iptc_key) 52 52 { 53 if (isset($iptc[$iptc_key][0]) and $value = $iptc[$iptc_key][0])53 if (isset($iptc[$iptc_key][0])) 54 54 { 55 // strip leading zeros (weird Kodak Scanner software) 56 while ($value[0] == chr(0)) 55 if ($iptc_key == '2#025') 57 56 { 58 $value = substr($value, 1); 57 $value = implode(',', 58 array_map('clean_iptc_value',$iptc[$iptc_key])); 59 59 } 60 // remove binary nulls 61 $value = str_replace(chr(0x00), ' ', $value); 62 60 else 61 { 62 $value = clean_iptc_value($iptc[$iptc_key][0]); 63 } 64 63 65 foreach (array_keys($map, $iptc_key) as $pwg_key) 64 66 { … … 71 73 return $result; 72 74 } 75 76 /** 77 * return a cleaned IPTC value 78 * 79 * @param string value 80 * @return string 81 */ 82 function clean_iptc_value($value) 83 { 84 // strip leading zeros (weird Kodak Scanner software) 85 while ($value[0] == chr(0)) 86 { 87 $value = substr($value, 1); 88 } 89 // remove binary nulls 90 $value = str_replace(chr(0x00), ' ', $value); 91 92 return $value; 93 } 73 94 ?>
Note: See TracChangeset
for help on using the changeset viewer.