Changeset 4998 for extensions/AMetaData/JpegMetaData/TagDefinitions
- Timestamp:
- Feb 28, 2010, 6:15:11 PM (15 years ago)
- Location:
- extensions/AMetaData/JpegMetaData/TagDefinitions
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/JpegMetaData/TagDefinitions/IfdTags.class.php
r4935 r4998 977 977 // flash, tag 0x9209, see EXIF 2.2 documentation 978 978 0x9209 => Array( 979 'tagName' => " flash",979 'tagName' => "Flash", 980 980 'schema' => "exif", 981 981 'translatable'=> true, … … 990 990 ), 991 991 'tagValues.specialValues' => Array( 992 0x000 0 => Array( // b00000001992 0x0001 => Array( // b00000001 => 'fired' 993 993 0x00 => "flash did not fire", 994 994 0x01 => "flash fired" 995 995 ), 996 0x0006 => Array( // b00000110 996 0x0006 => Array( // b00000110 => 'return' 997 997 0x00 => "no strobe", // 00 998 998 0x01 => "reserved", // 01 … … 1000 1000 0x03 => "strobe return light detected" // 11 1001 1001 ), 1002 0x0018 => Array( // b00011000 1002 0x0018 => Array( // b00011000 => 'mode' 1003 1003 0x00 => "unknown", 1004 1004 0x01 => "compulsory flash firing", 1005 0x 10=> "compulsory flash suppression",1006 0x 11=> "auto mode"1005 0x02 => "compulsory flash suppression", 1006 0x03 => "auto mode" 1007 1007 ), 1008 0x0020 => Array( // b00100000 1008 0x0020 => Array( // b00100000 => 'function' 1009 1009 0x00 => "flash function present", 1010 1010 0x01 => "no flash function" 1011 1011 ), 1012 0x0040 => Array( // b01000000 1012 0x0040 => Array( // b01000000 => 'red-eye' 1013 1013 0x00 => "no red-eye reduction mode or unknown", 1014 1014 0x01 => "red-eye reduction supported" -
extensions/AMetaData/JpegMetaData/TagDefinitions/XmpTags.class.php
r4972 r4998 48 48 class XmpTags extends KnownTags 49 49 { 50 /** 51 * this function extract from an Xmp Alt structure, the value in the given 52 * lang 53 * 54 * @param Array $tagValues : 55 * @param String $lang : the needed lang 56 * @return String : the value in the specified lang, or in the default lang 57 * if there is no specific value for the specified lang 58 */ 59 static public function getAltValue($tagValues, $lang="x-default") 60 { 61 /* 62 * test if the $tagValues is valid, otherwise return the $tagValues as 63 * result 64 */ 65 if(!is_array($tagValues)) return($tagValues); 66 if(!array_key_exists("type", $tagValues) or 67 !array_key_exists("values", $tagValues) ) 68 return($tagValues); 69 if($tagValues['type']!="alt") return($tagValues); 70 71 $returned=""; 72 foreach($tagValues['values'] as $key => $val) 73 { 74 if($val['type']['value']==$lang or 75 XmpTags::lang($val['type']['value'])==$lang or 76 $val['type']['value']=="x-default") 77 $returned=$val['value']; 78 } 79 return($returned); 80 } 81 82 /** 83 * this function tries to format the lang Id 84 * something like "fr-fr" is returned as "fr_FR" 85 */ 86 static private function lang($lang) 87 { 88 $result=preg_match("/([a-z]*)([-|_])([a-z]*)/i", $lang, $arr); 89 return($arr[1]."_".strtoupper($arr[3])); 90 } 91 50 92 const TYPE_SIMPLE = 0x00; 51 93 const TYPE_SEQ = 0x01; … … 1308 1350 /* 1309 1351 * The Flash is a sequence of Flash structure 1310 * Not yet implemented 1352 * Don't use the exif:Flash, but the associated tags : 1353 * exif:Fired, exif:Return, exif:Mode, exif:Function, exif:RedEyeMode 1311 1354 */ 1312 1355 'exif:Flash' => Array( … … 1317 1360 'schema' => "exif", 1318 1361 ), 1362 1363 'exif:Fired' => Array( 1364 'implemented' => true, 1365 'translatable' => true, 1366 'type' => self::TYPE_SIMPLE, 1367 'schema' => "exif", 1368 'tagValues' => Array( 1369 'False' => "flash did not fire", 1370 'True' => "flash fired" 1371 ), 1372 ), 1373 1374 'exif:Return' => Array( 1375 'implemented' => true, 1376 'translatable' => true, 1377 'type' => self::TYPE_SIMPLE, 1378 'schema' => "exif", 1379 'tagValues' => Array( 1380 0x00 => "no strobe", 1381 0x01 => "reserved", 1382 0x02 => "strobe return light not detected", 1383 0x03 => "strobe return light detected" 1384 ), 1385 ), 1386 1387 'exif:Mode' => Array( 1388 'implemented' => true, 1389 'translatable' => true, 1390 'type' => self::TYPE_SIMPLE, 1391 'schema' => "exif", 1392 'tagValues' => Array( 1393 0x00 => "unknown", 1394 0x01 => "compulsory flash firing", 1395 0x02 => "compulsory flash suppression", 1396 0x03 => "auto mode" 1397 ), 1398 ), 1399 1400 'exif:Function' => Array( 1401 'implemented' => true, 1402 'translatable' => true, 1403 'type' => self::TYPE_SIMPLE, 1404 'schema' => "exif", 1405 'tagValues' => Array( 1406 'False' => "flash function present", 1407 'True' => "no flash function" 1408 ), 1409 ), 1410 1411 'exif:RedEyeMode' => Array( 1412 'implemented' => true, 1413 'translatable' => true, 1414 'type' => self::TYPE_SIMPLE, 1415 'schema' => "exif", 1416 'tagValues' => Array( 1417 'False' => "no red-eye reduction mode or unknown", 1418 'True' => "red-eye reduction supported" 1419 ), 1420 ), 1421 1319 1422 'exif:FocalLength' => Array( 1320 1423 'exifTag' => 0x920A,
Note: See TracChangeset
for help on using the changeset viewer.