MediaWiki
REL1_19
|
00001 <?php 00007 class XMPInfo { 00008 00012 public static function getItems ( ) { 00013 if( !self::$ranHooks ) { 00014 // This is for if someone makes a custom metadata extension. 00015 // For example, a medical wiki might want to decode DICOM xmp properties. 00016 wfRunHooks('XMPGetInfo', Array(&self::$items)); 00017 self::$ranHooks = true; // Only want to do this once. 00018 } 00019 return self::$items; 00020 } 00021 00022 static private $ranHooks = false; 00023 00045 static private $items = array( 00046 'http://ns.adobe.com/exif/1.0/' => array( 00047 'ApertureValue' => array( 00048 'map_group' => 'exif', 00049 'mode' => XMPReader::MODE_SIMPLE, 00050 'validate' => 'validateRational' 00051 ), 00052 'BrightnessValue' => array( 00053 'map_group' => 'exif', 00054 'mode' => XMPReader::MODE_SIMPLE, 00055 'validate' => 'validateRational' 00056 ), 00057 'CompressedBitsPerPixel' => array( 00058 'map_group' => 'exif', 00059 'mode' => XMPReader::MODE_SIMPLE, 00060 'validate' => 'validateRational' 00061 ), 00062 'DigitalZoomRatio' => array( 00063 'map_group' => 'exif', 00064 'mode' => XMPReader::MODE_SIMPLE, 00065 'validate' => 'validateRational' 00066 ), 00067 'ExposureBiasValue' => array( 00068 'map_group' => 'exif', 00069 'mode' => XMPReader::MODE_SIMPLE, 00070 'validate' => 'validateRational' 00071 ), 00072 'ExposureIndex' => array( 00073 'map_group' => 'exif', 00074 'mode' => XMPReader::MODE_SIMPLE, 00075 'validate' => 'validateRational' 00076 ), 00077 'ExposureTime' => array( 00078 'map_group' => 'exif', 00079 'mode' => XMPReader::MODE_SIMPLE, 00080 'validate' => 'validateRational' 00081 ), 00082 'FlashEnergy' => array( 00083 'map_group' => 'exif', 00084 'mode' => XMPReader::MODE_SIMPLE, 00085 'validate' => 'validateRational', 00086 ), 00087 'FNumber' => array( 00088 'map_group' => 'exif', 00089 'mode' => XMPReader::MODE_SIMPLE, 00090 'validate' => 'validateRational' 00091 ), 00092 'FocalLength' => array( 00093 'map_group' => 'exif', 00094 'mode' => XMPReader::MODE_SIMPLE, 00095 'validate' => 'validateRational' 00096 ), 00097 'FocalPlaneXResolution' => array( 00098 'map_group' => 'exif', 00099 'mode' => XMPReader::MODE_SIMPLE, 00100 'validate' => 'validateRational' 00101 ), 00102 'FocalPlaneYResolution' => array( 00103 'map_group' => 'exif', 00104 'mode' => XMPReader::MODE_SIMPLE, 00105 'validate' => 'validateRational' 00106 ), 00107 'GPSAltitude' => array( 00108 'map_group' => 'exif', 00109 'mode' => XMPReader::MODE_SIMPLE, 00110 'validate' => 'validateRational', 00111 ), 00112 'GPSDestBearing' => array( 00113 'map_group' => 'exif', 00114 'mode' => XMPReader::MODE_SIMPLE, 00115 'validate' => 'validateRational' 00116 ), 00117 'GPSDestDistance' => array( 00118 'map_group' => 'exif', 00119 'mode' => XMPReader::MODE_SIMPLE, 00120 'validate' => 'validateRational' 00121 ), 00122 'GPSDOP' => array( 00123 'map_group' => 'exif', 00124 'mode' => XMPReader::MODE_SIMPLE, 00125 'validate' => 'validateRational' 00126 ), 00127 'GPSImgDirection' => array( 00128 'map_group' => 'exif', 00129 'mode' => XMPReader::MODE_SIMPLE, 00130 'validate' => 'validateRational' 00131 ), 00132 'GPSSpeed' => array( 00133 'map_group' => 'exif', 00134 'mode' => XMPReader::MODE_SIMPLE, 00135 'validate' => 'validateRational' 00136 ), 00137 'GPSTrack' => array( 00138 'map_group' => 'exif', 00139 'mode' => XMPReader::MODE_SIMPLE, 00140 'validate' => 'validateRational' 00141 ), 00142 'MaxApertureValue' => array( 00143 'map_group' => 'exif', 00144 'mode' => XMPReader::MODE_SIMPLE, 00145 'validate' => 'validateRational' 00146 ), 00147 'ShutterSpeedValue' => array( 00148 'map_group' => 'exif', 00149 'mode' => XMPReader::MODE_SIMPLE, 00150 'validate' => 'validateRational' 00151 ), 00152 'SubjectDistance' => array( 00153 'map_group' => 'exif', 00154 'mode' => XMPReader::MODE_SIMPLE, 00155 'validate' => 'validateRational' 00156 ), 00157 /* Flash */ 00158 'Flash' => array( 00159 'mode' => XMPReader::MODE_STRUCT, 00160 'children' => array( 00161 'Fired' => true, 00162 'Function' => true, 00163 'Mode' => true, 00164 'RedEyeMode' => true, 00165 'Return' => true, 00166 ), 00167 'validate' => 'validateFlash', 00168 'map_group' => 'exif', 00169 ), 00170 'Fired' => array( 00171 'map_group' => 'exif', 00172 'validate' => 'validateBoolean', 00173 'mode' => XMPReader::MODE_SIMPLE, 00174 'structPart'=> true, 00175 ), 00176 'Function' => array( 00177 'map_group' => 'exif', 00178 'validate' => 'validateBoolean', 00179 'mode' => XMPReader::MODE_SIMPLE, 00180 'structPart'=> true, 00181 ), 00182 'Mode' => array( 00183 'map_group' => 'exif', 00184 'validate' => 'validateClosed', 00185 'mode' => XMPReader::MODE_SIMPLE, 00186 'choices' => array( '0' => true, '1' => true, 00187 '2' => true, '3' => true ), 00188 'structPart'=> true, 00189 ), 00190 'Return' => array( 00191 'map_group' => 'exif', 00192 'validate' => 'validateClosed', 00193 'mode' => XMPReader::MODE_SIMPLE, 00194 'choices' => array( '0' => true, 00195 '2' => true, '3' => true ), 00196 'structPart'=> true, 00197 ), 00198 'RedEyeMode' => array( 00199 'map_group' => 'exif', 00200 'validate' => 'validateBoolean', 00201 'mode' => XMPReader::MODE_SIMPLE, 00202 'structPart'=> true, 00203 ), 00204 /* End Flash */ 00205 'ISOSpeedRatings' => array( 00206 'map_group' => 'exif', 00207 'mode' => XMPReader::MODE_SEQ, 00208 'validate' => 'validateInteger' 00209 ), 00210 /* end rational things */ 00211 'ColorSpace' => array( 00212 'map_group' => 'exif', 00213 'mode' => XMPReader::MODE_SIMPLE, 00214 'validate' => 'validateClosed', 00215 'choices' => array( '1' => true, '65535' => true ), 00216 ), 00217 'ComponentsConfiguration' => array( 00218 'map_group' => 'exif', 00219 'mode' => XMPReader::MODE_SEQ, 00220 'validate' => 'validateClosed', 00221 'choices' => array( '1' => true, '2' => true, '3' => true, '4' => true, 00222 '5' => true, '6' => true ) 00223 ), 00224 'Contrast' => array( 00225 'map_group' => 'exif', 00226 'mode' => XMPReader::MODE_SIMPLE, 00227 'validate' => 'validateClosed', 00228 'choices' => array( '0' => true, '1' => true, '2' => true ) 00229 ), 00230 'CustomRendered' => array( 00231 'map_group' => 'exif', 00232 'mode' => XMPReader::MODE_SIMPLE, 00233 'validate' => 'validateClosed', 00234 'choices' => array( '0' => true, '1' => true ) 00235 ), 00236 'DateTimeOriginal' => array( 00237 'map_group' => 'exif', 00238 'mode' => XMPReader::MODE_SIMPLE, 00239 'validate' => 'validateDate', 00240 ), 00241 'DateTimeDigitized' => array( /* xmp:CreateDate */ 00242 'map_group' => 'exif', 00243 'mode' => XMPReader::MODE_SIMPLE, 00244 'validate' => 'validateDate', 00245 ), 00246 /* todo: there might be interesting information in 00247 * exif:DeviceSettingDescription, but need to find an 00248 * example 00249 */ 00250 'ExifVersion' => array( 00251 'map_group' => 'exif', 00252 'mode' => XMPReader::MODE_SIMPLE, 00253 ), 00254 'ExposureMode' => array( 00255 'map_group' => 'exif', 00256 'mode' => XMPReader::MODE_SIMPLE, 00257 'validate' => 'validateClosed', 00258 'rangeLow' => 0, 00259 'rangeHigh' => 2, 00260 ), 00261 'ExposureProgram' => array( 00262 'map_group' => 'exif', 00263 'mode' => XMPReader::MODE_SIMPLE, 00264 'validate' => 'validateClosed', 00265 'rangeLow' => 0, 00266 'rangeHigh' => 8, 00267 ), 00268 'FileSource' => array( 00269 'map_group' => 'exif', 00270 'mode' => XMPReader::MODE_SIMPLE, 00271 'validate' => 'validateClosed', 00272 'choices' => array( '3' => true ) 00273 ), 00274 'FlashpixVersion' => array( 00275 'map_group' => 'exif', 00276 'mode' => XMPReader::MODE_SIMPLE, 00277 ), 00278 'FocalLengthIn35mmFilm' => array( 00279 'map_group' => 'exif', 00280 'mode' => XMPReader::MODE_SIMPLE, 00281 'validate' => 'validateInteger', 00282 ), 00283 'FocalPlaneResolutionUnit' => array( 00284 'map_group' => 'exif', 00285 'mode' => XMPReader::MODE_SIMPLE, 00286 'validate' => 'validateClosed', 00287 'choices' => array( '2' => true, '3' => true ), 00288 ), 00289 'GainControl' => array( 00290 'map_group' => 'exif', 00291 'mode' => XMPReader::MODE_SIMPLE, 00292 'validate' => 'validateClosed', 00293 'rangeLow' => 0, 00294 'rangeHigh' => 4, 00295 ), 00296 /* this value is post-processed out later */ 00297 'GPSAltitudeRef' => array( 00298 'map_group' => 'exif', 00299 'mode' => XMPReader::MODE_SIMPLE, 00300 'validate' => 'validateClosed', 00301 'choices' => array( '0' => true, '1' => true ), 00302 ), 00303 'GPSAreaInformation' => array( 00304 'map_group' => 'exif', 00305 'mode' => XMPReader::MODE_SIMPLE, 00306 ), 00307 'GPSDestBearingRef' => array( 00308 'map_group' => 'exif', 00309 'mode' => XMPReader::MODE_SIMPLE, 00310 'validate' => 'validateClosed', 00311 'choices' => array( 'T' => true, 'M' => true ), 00312 ), 00313 'GPSDestDistanceRef' => array( 00314 'map_group' => 'exif', 00315 'mode' => XMPReader::MODE_SIMPLE, 00316 'validate' => 'validateClosed', 00317 'choices' => array( 'K' => true, 'M' => true, 00318 'N' => true ), 00319 ), 00320 'GPSDestLatitude' => array( 00321 'map_group' => 'exif', 00322 'mode' => XMPReader::MODE_SIMPLE, 00323 'validate' => 'validateGPS', 00324 ), 00325 'GPSDestLongitude' => array( 00326 'map_group' => 'exif', 00327 'mode' => XMPReader::MODE_SIMPLE, 00328 'validate' => 'validateGPS', 00329 ), 00330 'GPSDifferential' => array( 00331 'map_group' => 'exif', 00332 'mode' => XMPReader::MODE_SIMPLE, 00333 'validate' => 'validateClosed', 00334 'choices' => array( '0' => true, '1' => true ), 00335 ), 00336 'GPSImgDirectionRef' => array( 00337 'map_group' => 'exif', 00338 'mode' => XMPReader::MODE_SIMPLE, 00339 'validate' => 'validateClosed', 00340 'choices' => array( 'T' => true, 'M' => true ), 00341 ), 00342 'GPSLatitude' => array( 00343 'map_group' => 'exif', 00344 'mode' => XMPReader::MODE_SIMPLE, 00345 'validate' => 'validateGPS', 00346 ), 00347 'GPSLongitude' => array( 00348 'map_group' => 'exif', 00349 'mode' => XMPReader::MODE_SIMPLE, 00350 'validate' => 'validateGPS', 00351 ), 00352 'GPSMapDatum' => array( 00353 'map_group' => 'exif', 00354 'mode' => XMPReader::MODE_SIMPLE, 00355 ), 00356 'GPSMeasureMode' => array( 00357 'map_group' => 'exif', 00358 'mode' => XMPReader::MODE_SIMPLE, 00359 'validate' => 'validateClosed', 00360 'choices' => array( '2' => true, '3' => true ) 00361 ), 00362 'GPSProcessingMethod' => array( 00363 'map_group' => 'exif', 00364 'mode' => XMPReader::MODE_SIMPLE, 00365 ), 00366 'GPSSatellites' => array( 00367 'map_group' => 'exif', 00368 'mode' => XMPReader::MODE_SIMPLE, 00369 ), 00370 'GPSSpeedRef' => array( 00371 'map_group' => 'exif', 00372 'mode' => XMPReader::MODE_SIMPLE, 00373 'validate' => 'validateClosed', 00374 'choices' => array( 'K' => true, 'M' => true, 00375 'N' => true ), 00376 ), 00377 'GPSStatus' => array( 00378 'map_group' => 'exif', 00379 'mode' => XMPReader::MODE_SIMPLE, 00380 'validate' => 'validateClosed', 00381 'choices' => array( 'A' => true, 'V' => true ) 00382 ), 00383 'GPSTimeStamp' => array( 00384 'map_group' => 'exif', 00385 // Note: in exif, GPSDateStamp does not include 00386 // the time, where here it does. 00387 'map_name' => 'GPSDateStamp', 00388 'mode' => XMPReader::MODE_SIMPLE, 00389 'validate' => 'validateDate', 00390 ), 00391 'GPSTrackRef' => array( 00392 'map_group' => 'exif', 00393 'mode' => XMPReader::MODE_SIMPLE, 00394 'validate' => 'validateClosed', 00395 'choices' => array( 'T' => true, 'M' => true ) 00396 ), 00397 'GPSVersionID' => array( 00398 'map_group' => 'exif', 00399 'mode' => XMPReader::MODE_SIMPLE, 00400 ), 00401 'ImageUniqueID' => array( 00402 'map_group' => 'exif', 00403 'mode' => XMPReader::MODE_SIMPLE, 00404 ), 00405 'LightSource' => array( 00406 'map_group' => 'exif', 00407 'mode' => XMPReader::MODE_SIMPLE, 00408 'validate' => 'validateClosed', 00409 /* can't use a range, as it skips... */ 00410 'choices' => array( '0' => true, '1' => true, 00411 '2' => true, '3' => true, '4' => true, 00412 '9' => true, '10' => true, '11' => true, 00413 '12' => true, '13' => true, 00414 '14' => true, '15' => true, 00415 '17' => true, '18' => true, 00416 '19' => true, '20' => true, 00417 '21' => true, '22' => true, 00418 '23' => true, '24' => true, 00419 '255' => true, 00420 ), 00421 ), 00422 'MeteringMode' => array( 00423 'map_group' => 'exif', 00424 'mode' => XMPReader::MODE_SIMPLE, 00425 'validate' => 'validateClosed', 00426 'rangeLow' => 0, 00427 'rangeHigh' => 6, 00428 'choices' => array( '255' => true ), 00429 ), 00430 /* Pixel(X|Y)Dimension are rather useless, but for 00431 * completeness since we do it with exif. 00432 */ 00433 'PixelXDimension' => array( 00434 'map_group' => 'exif', 00435 'mode' => XMPReader::MODE_SIMPLE, 00436 'validate' => 'validateInteger', 00437 ), 00438 'PixelYDimension' => array( 00439 'map_group' => 'exif', 00440 'mode' => XMPReader::MODE_SIMPLE, 00441 'validate' => 'validateInteger', 00442 ), 00443 'Saturation' => array( 00444 'map_group' => 'exif', 00445 'mode' => XMPReader::MODE_SIMPLE, 00446 'validate' => 'validateClosed', 00447 'rangeLow' => 0, 00448 'rangeHigh' => 2, 00449 ), 00450 'SceneCaptureType' => array( 00451 'map_group' => 'exif', 00452 'mode' => XMPReader::MODE_SIMPLE, 00453 'validate' => 'validateClosed', 00454 'rangeLow' => 0, 00455 'rangeHigh' => 3, 00456 ), 00457 'SceneType' => array( 00458 'map_group' => 'exif', 00459 'mode' => XMPReader::MODE_SIMPLE, 00460 'validate' => 'validateClosed', 00461 'choices' => array( '1' => true ), 00462 ), 00463 // Note, 6 is not valid SensingMethod. 00464 'SensingMethod' => array( 00465 'map_group' => 'exif', 00466 'mode' => XMPReader::MODE_SIMPLE, 00467 'validate' => 'validateClosed', 00468 'rangeLow' => 1, 00469 'rangeHigh' => 5, 00470 'choices' => array( '7' => true, 8 => true ), 00471 ), 00472 'Sharpness' => array( 00473 'map_group' => 'exif', 00474 'mode' => XMPReader::MODE_SIMPLE, 00475 'validate' => 'validateClosed', 00476 'rangeLow' => 0, 00477 'rangeHigh' => 2, 00478 ), 00479 'SpectralSensitivity' => array( 00480 'map_group' => 'exif', 00481 'mode' => XMPReader::MODE_SIMPLE, 00482 ), 00483 // This tag should perhaps be displayed to user better. 00484 'SubjectArea' => array( 00485 'map_group' => 'exif', 00486 'mode' => XMPReader::MODE_SEQ, 00487 'validate' => 'validateInteger', 00488 ), 00489 'SubjectDistanceRange' => array( 00490 'map_group' => 'exif', 00491 'mode' => XMPReader::MODE_SIMPLE, 00492 'validate' => 'validateClosed', 00493 'rangeLow' => 0, 00494 'rangeHigh' => 3, 00495 ), 00496 'SubjectLocation' => array( 00497 'map_group' => 'exif', 00498 'mode' => XMPReader::MODE_SEQ, 00499 'validate' => 'validateInteger', 00500 ), 00501 'UserComment' => array( 00502 'map_group' => 'exif', 00503 'mode' => XMPReader::MODE_LANG, 00504 ), 00505 'WhiteBalance' => array( 00506 'map_group' => 'exif', 00507 'mode' => XMPReader::MODE_SIMPLE, 00508 'validate' => 'validateClosed', 00509 'choices' => array( '0' => true, '1' => true ) 00510 ), 00511 ), 00512 'http://ns.adobe.com/tiff/1.0/' => array( 00513 'Artist' => array( 00514 'map_group' => 'exif', 00515 'mode' => XMPReader::MODE_SIMPLE, 00516 ), 00517 'BitsPerSample' => array( 00518 'map_group' => 'exif', 00519 'mode' => XMPReader::MODE_SEQ, 00520 'validate' => 'validateInteger', 00521 ), 00522 'Compression' => array( 00523 'map_group' => 'exif', 00524 'mode' => XMPReader::MODE_SIMPLE, 00525 'validate' => 'validateClosed', 00526 'choices' => array( '1' => true, '6' => true ), 00527 ), 00528 /* this prop should not be used in XMP. dc:rights is the correct prop */ 00529 'Copyright' => array( 00530 'map_group' => 'exif', 00531 'mode' => XMPReader::MODE_LANG, 00532 ), 00533 'DateTime' => array( /* proper prop is xmp:ModifyDate */ 00534 'map_group' => 'exif', 00535 'mode' => XMPReader::MODE_SIMPLE, 00536 'validate' => 'validateDate', 00537 ), 00538 'ImageDescription' => array( /* proper one is dc:description */ 00539 'map_group' => 'exif', 00540 'mode' => XMPReader::MODE_LANG, 00541 ), 00542 'ImageLength' => array( 00543 'map_group' => 'exif', 00544 'mode' => XMPReader::MODE_SIMPLE, 00545 'validate' => 'validateInteger', 00546 ), 00547 'ImageWidth' => array( 00548 'map_group' => 'exif', 00549 'mode' => XMPReader::MODE_SIMPLE, 00550 'validate' => 'validateInteger', 00551 ), 00552 'Make' => array( 00553 'map_group' => 'exif', 00554 'mode' => XMPReader::MODE_SIMPLE, 00555 ), 00556 'Model' => array( 00557 'map_group' => 'exif', 00558 'mode' => XMPReader::MODE_SIMPLE, 00559 ), 00560 /**** Do not extract this property 00561 * It interferes with auto exif rotation. 00562 * 'Orientation' => array( 00563 * 'map_group' => 'exif', 00564 * 'mode' => XMPReader::MODE_SIMPLE, 00565 * 'validate' => 'validateClosed', 00566 * 'choices' => array( '1' => true, '2' => true, '3' => true, '4' => true, 5 => true, 00567 * '6' => true, '7' => true, '8' => true ), 00568 *), 00569 ******/ 00570 'PhotometricInterpretation' => array( 00571 'map_group' => 'exif', 00572 'mode' => XMPReader::MODE_SIMPLE, 00573 'validate' => 'validateClosed', 00574 'choices' => array( '2' => true, '6' => true ), 00575 ), 00576 'PlanerConfiguration' => array( 00577 'map_group' => 'exif', 00578 'mode' => XMPReader::MODE_SIMPLE, 00579 'validate' => 'validateClosed', 00580 'choices' => array( '1' => true, '2' => true ), 00581 ), 00582 'PrimaryChromaticities' => array( 00583 'map_group' => 'exif', 00584 'mode' => XMPReader::MODE_SEQ, 00585 'validate' => 'validateRational', 00586 ), 00587 'ReferenceBlackWhite' => array( 00588 'map_group' => 'exif', 00589 'mode' => XMPReader::MODE_SEQ, 00590 'validate' => 'validateRational', 00591 ), 00592 'ResolutionUnit' => array( 00593 'map_group' => 'exif', 00594 'mode' => XMPReader::MODE_SIMPLE, 00595 'validate' => 'validateClosed', 00596 'choices' => array( '2' => true, '3' => true ), 00597 ), 00598 'SamplesPerPixel' => array( 00599 'map_group' => 'exif', 00600 'mode' => XMPReader::MODE_SIMPLE, 00601 'validate' => 'validateInteger', 00602 ), 00603 'Software' => array( /* see xmp:CreatorTool */ 00604 'map_group' => 'exif', 00605 'mode' => XMPReader::MODE_SIMPLE, 00606 ), 00607 /* ignore TransferFunction */ 00608 'WhitePoint' => array( 00609 'map_group' => 'exif', 00610 'mode' => XMPReader::MODE_SEQ, 00611 'validate' => 'validateRational', 00612 ), 00613 'XResolution' => array( 00614 'map_group' => 'exif', 00615 'mode' => XMPReader::MODE_SIMPLE, 00616 'validate' => 'validateRational', 00617 ), 00618 'YResolution' => array( 00619 'map_group' => 'exif', 00620 'mode' => XMPReader::MODE_SIMPLE, 00621 'validate' => 'validateRational', 00622 ), 00623 'YCbCrCoefficients' => array( 00624 'map_group' => 'exif', 00625 'mode' => XMPReader::MODE_SEQ, 00626 'validate' => 'validateRational', 00627 ), 00628 'YCbCrPositioning' => array( 00629 'map_group' => 'exif', 00630 'mode' => XMPReader::MODE_SIMPLE, 00631 'validate' => 'validateClosed', 00632 'choices' => array( '1' => true, '2' => true ), 00633 ), 00634 /******** 00635 * Disable extracting this property (bug 31944) 00636 * Several files have a string instead of a Seq 00637 * for this property. XMPReader doesn't handle 00638 * mismatched types very gracefully (it marks 00639 * the entire file as invalid, instead of just 00640 * the relavent prop). Since this prop 00641 * doesn't communicate all that useful information 00642 * just disable this prop for now, until such 00643 * XMPReader is more graceful (bug 32172) 00644 * 'YCbCrSubSampling' => array( 00645 * 'map_group' => 'exif', 00646 * 'mode' => XMPReader::MODE_SEQ, 00647 * 'validate' => 'validateClosed', 00648 * 'choices' => array( '1' => true, '2' => true ), 00649 * ), 00650 */ 00651 ), 00652 'http://ns.adobe.com/exif/1.0/aux/' => array( 00653 'Lens' => array( 00654 'map_group' => 'exif', 00655 'mode' => XMPReader::MODE_SIMPLE, 00656 ), 00657 'SerialNumber' => array( 00658 'map_group' => 'exif', 00659 'mode' => XMPReader::MODE_SIMPLE, 00660 ), 00661 'OwnerName' => array( 00662 'map_group' => 'exif', 00663 'map_name' => 'CameraOwnerName', 00664 'mode' => XMPReader::MODE_SIMPLE, 00665 ), 00666 ), 00667 'http://purl.org/dc/elements/1.1/' => array( 00668 'title' => array( 00669 'map_group' => 'general', 00670 'map_name' => 'ObjectName', 00671 'mode' => XMPReader::MODE_LANG 00672 ), 00673 'description' => array( 00674 'map_group' => 'general', 00675 'map_name' => 'ImageDescription', 00676 'mode' => XMPReader::MODE_LANG 00677 ), 00678 'contributor' => array( 00679 'map_group' => 'general', 00680 'map_name' => 'dc-contributor', 00681 'mode' => XMPReader::MODE_BAG 00682 ), 00683 'coverage' => array( 00684 'map_group' => 'general', 00685 'map_name' => 'dc-coverage', 00686 'mode' => XMPReader::MODE_SIMPLE, 00687 ), 00688 'creator' => array( 00689 'map_group' => 'general', 00690 'map_name' => 'Artist', //map with exif Artist, iptc byline (2:80) 00691 'mode' => XMPReader::MODE_SEQ, 00692 ), 00693 'date' => array( 00694 'map_group' => 'general', 00695 // Note, not mapped with other date properties, as this type of date is 00696 // non-specific: "A point or period of time associated with an event in 00697 // the lifecycle of the resource" 00698 'map_name' => 'dc-date', 00699 'mode' => XMPReader::MODE_SEQ, 00700 'validate' => 'validateDate', 00701 ), 00702 /* Do not extract dc:format, as we've got better ways to determine mimetype */ 00703 'identifier' => array( 00704 'map_group' => 'deprecated', 00705 'map_name' => 'Identifier', 00706 'mode' => XMPReader::MODE_SIMPLE, 00707 ), 00708 'language' => array( 00709 'map_group' => 'general', 00710 'map_name' => 'LanguageCode', /* mapped with iptc 2:135 */ 00711 'mode' => XMPReader::MODE_BAG, 00712 'validate' => 'validateLangCode', 00713 ), 00714 'publisher' => array( 00715 'map_group' => 'general', 00716 'map_name' => 'dc-publisher', 00717 'mode' => XMPReader::MODE_BAG, 00718 ), 00719 // for related images/resources 00720 'relation' => array( 00721 'map_group' => 'general', 00722 'map_name' => 'dc-relation', 00723 'mode' => XMPReader::MODE_BAG, 00724 ), 00725 'rights' => array( 00726 'map_group' => 'general', 00727 'map_name' => 'Copyright', 00728 'mode' => XMPReader::MODE_LANG, 00729 ), 00730 // Note: source is not mapped with iptc source, since iptc 00731 // source describes the source of the image in terms of a person 00732 // who provided the image, where this is to describe an image that the 00733 // current one is based on. 00734 'source' => array( 00735 'map_group' => 'general', 00736 'map_name' => 'dc-source', 00737 'mode' => XMPReader::MODE_SIMPLE, 00738 ), 00739 'subject' => array( 00740 'map_group' => 'general', 00741 'map_name' => 'Keywords', /* maps to iptc 2:25 */ 00742 'mode' => XMPReader::MODE_BAG, 00743 ), 00744 'type' => array( 00745 'map_group' => 'general', 00746 'map_name' => 'dc-type', 00747 'mode' => XMPReader::MODE_BAG, 00748 ), 00749 ), 00750 'http://ns.adobe.com/xap/1.0/' => array( 00751 'CreateDate' => array( 00752 'map_group' => 'general', 00753 'map_name' => 'DateTimeDigitized', 00754 'mode' => XMPReader::MODE_SIMPLE, 00755 'validate' => 'validateDate', 00756 ), 00757 'CreatorTool' => array( 00758 'map_group' => 'general', 00759 'map_name' => 'Software', 00760 'mode' => XMPReader::MODE_SIMPLE 00761 ), 00762 'Identifier' => array( 00763 'map_group' => 'general', 00764 'mode' => XMPReader::MODE_BAG, 00765 ), 00766 'Label' => array( 00767 'map_group' => 'general', 00768 'mode' => XMPReader::MODE_SIMPLE, 00769 ), 00770 'ModifyDate' => array( 00771 'map_group' => 'general', 00772 'mode' => XMPReader::MODE_SIMPLE, 00773 'map_name' => 'DateTime', 00774 'validate' => 'validateDate', 00775 ), 00776 'MetadataDate' => array( 00777 'map_group' => 'general', 00778 'mode' => XMPReader::MODE_SIMPLE, 00779 // map_name to be consistent with other date names. 00780 'map_name' => 'DateTimeMetadata', 00781 'validate' => 'validateDate', 00782 ), 00783 'Nickname' => array( 00784 'map_group' => 'general', 00785 'mode' => XMPReader::MODE_SIMPLE, 00786 ), 00787 'Rating' => array( 00788 'map_group' => 'general', 00789 'mode' => XMPReader::MODE_SIMPLE, 00790 'validate' => 'validateRating', 00791 ), 00792 ), 00793 'http://ns.adobe.com/xap/1.0/rights/' => array( 00794 'Certificate' => array( 00795 'map_group' => 'general', 00796 'map_name' => 'RightsCertificate', 00797 'mode' => XMPReader::MODE_SIMPLE, 00798 ), 00799 'Marked' => array( 00800 'map_group' => 'general', 00801 'map_name' => 'Copyrighted', 00802 'mode' => XMPReader::MODE_SIMPLE, 00803 'validate' => 'validateBoolean', 00804 ), 00805 'Owner' => array( 00806 'map_group' => 'general', 00807 'map_name' => 'CopyrightOwner', 00808 'mode' => XMPReader::MODE_BAG, 00809 ), 00810 // this seems similar to dc:rights. 00811 'UsageTerms' => array( 00812 'map_group' => 'general', 00813 'mode' => XMPReader::MODE_LANG, 00814 ), 00815 'WebStatement' => array( 00816 'map_group' => 'general', 00817 'mode' => XMPReader::MODE_SIMPLE, 00818 ), 00819 ), 00820 // XMP media management. 00821 'http://ns.adobe.com/xap/1.0/mm/' => array( 00822 // if we extract the exif UniqueImageID, might 00823 // as well do this too. 00824 'OriginalDocumentID' => array( 00825 'map_group' => 'general', 00826 'mode' => XMPReader::MODE_SIMPLE, 00827 ), 00828 // It might also be useful to do xmpMM:LastURL 00829 // and xmpMM:DerivedFrom as you can potentially, 00830 // get the url of this document/source for this 00831 // document. However whats more likely is you'd 00832 // get a file:// url for the path of the doc, 00833 // which is somewhat of a privacy issue. 00834 ), 00835 'http://creativecommons.org/ns#' => array( 00836 'license' => array( 00837 'map_name' => 'LicenseUrl', 00838 'map_group' => 'general', 00839 'mode' => XMPReader::MODE_SIMPLE, 00840 ), 00841 'morePermissions' => array( 00842 'map_name' => 'MorePermissionsUrl', 00843 'map_group' => 'general', 00844 'mode' => XMPReader::MODE_SIMPLE, 00845 ), 00846 'attributionURL' => array( 00847 'map_group' => 'general', 00848 'map_name' => 'AttributionUrl', 00849 'mode' => XMPReader::MODE_SIMPLE, 00850 ), 00851 'attributionName' => array( 00852 'map_group' => 'general', 00853 'map_name' => 'PreferredAttributionName', 00854 'mode' => XMPReader::MODE_SIMPLE, 00855 ), 00856 ), 00857 //Note, this property affects how jpeg metadata is extracted. 00858 'http://ns.adobe.com/xmp/note/' => array( 00859 'HasExtendedXMP' => array( 00860 'map_group' => 'special', 00861 'mode' => XMPReader::MODE_SIMPLE, 00862 ), 00863 ), 00864 /* Note, in iptc schemas, the legacy properties are denoted 00865 * as deprecated, since other properties should used instead, 00866 * and properties marked as deprecated in the standard are 00867 * are marked as general here as they don't have replacements 00868 */ 00869 'http://ns.adobe.com/photoshop/1.0/' => array( 00870 'City' => array( 00871 'map_group' => 'deprecated', 00872 'mode' => XMPReader::MODE_SIMPLE, 00873 'map_name' => 'CityDest', 00874 ), 00875 'Country' => array( 00876 'map_group' => 'deprecated', 00877 'mode' => XMPReader::MODE_SIMPLE, 00878 'map_name' => 'CountryDest', 00879 ), 00880 'State' => array( 00881 'map_group' => 'deprecated', 00882 'mode' => XMPReader::MODE_SIMPLE, 00883 'map_name' => 'ProvinceOrStateDest', 00884 ), 00885 'DateCreated' => array( 00886 'map_group' => 'deprecated', 00887 // marking as deprecated as the xmp prop preferred 00888 'mode' => XMPReader::MODE_SIMPLE, 00889 'map_name' => 'DateTimeOriginal', 00890 'validate' => 'validateDate', 00891 // note this prop is an XMP, not IPTC date 00892 ), 00893 'CaptionWriter' => array( 00894 'map_group' => 'general', 00895 'mode' => XMPReader::MODE_SIMPLE, 00896 'map_name' => 'Writer', 00897 ), 00898 'Instructions' => array( 00899 'map_group' => 'general', 00900 'mode' => XMPReader::MODE_SIMPLE, 00901 'map_name' => 'SpecialInstructions', 00902 ), 00903 'TransmissionReference' => array( 00904 'map_group' => 'general', 00905 'mode' => XMPReader::MODE_SIMPLE, 00906 'map_name' => 'OriginalTransmissionRef', 00907 ), 00908 'AuthorsPosition' => array( 00909 /* This corresponds with 2:85 00910 * By-line Title, which needs to be 00911 * handled weirdly to correspond 00912 * with iptc/exif. */ 00913 'map_group' => 'special', 00914 'mode' => XMPReader::MODE_SIMPLE 00915 ), 00916 'Credit' => array( 00917 'map_group' => 'general', 00918 'mode' => XMPReader::MODE_SIMPLE, 00919 ), 00920 'Source' => array( 00921 'map_group' => 'general', 00922 'mode' => XMPReader::MODE_SIMPLE, 00923 ), 00924 'Urgency' => array( 00925 'map_group' => 'general', 00926 'mode' => XMPReader::MODE_SIMPLE, 00927 ), 00928 'Category' => array( 00929 // Note, this prop is deprecated, but in general 00930 // group since it doesn't have a replacement. 00931 'map_group' => 'general', 00932 'mode' => XMPReader::MODE_SIMPLE, 00933 'map_name' => 'iimCategory', 00934 ), 00935 'SupplementalCategories' => array( 00936 'map_group' => 'general', 00937 'mode' => XMPReader::MODE_BAG, 00938 'map_name' => 'iimSupplementalCategory', 00939 ), 00940 'Headline' => array( 00941 'map_group' => 'general', 00942 'mode' => XMPReader::MODE_SIMPLE 00943 ), 00944 ), 00945 'http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/' => array( 00946 'CountryCode' => array( 00947 'map_group' => 'deprecated', 00948 'mode' => XMPReader::MODE_SIMPLE, 00949 'map_name' => 'CountryCodeDest', 00950 ), 00951 'IntellectualGenre' => array( 00952 'map_group' => 'general', 00953 'mode' => XMPReader::MODE_SIMPLE, 00954 ), 00955 // Note, this is a six digit code. 00956 // See: http://cv.iptc.org/newscodes/scene/ 00957 // Since these aren't really all that common, 00958 // we just show the number. 00959 'Scene' => array( 00960 'map_group' => 'general', 00961 'mode' => XMPReader::MODE_BAG, 00962 'validate' => 'validateInteger', 00963 'map_name' => 'SceneCode', 00964 ), 00965 /* Note: SubjectCode should be an 8 ascii digits. 00966 * it is not really an integer (has leading 0's, 00967 * cannot have a +/- sign), but validateInteger 00968 * will let it through. 00969 */ 00970 'SubjectCode' => array( 00971 'map_group' => 'general', 00972 'mode' => XMPReader::MODE_BAG, 00973 'map_name' => 'SubjectNewsCode', 00974 'validate' => 'validateInteger' 00975 ), 00976 'Location' => array( 00977 'map_group' => 'deprecated', 00978 'mode' => XMPReader::MODE_SIMPLE, 00979 'map_name' => 'SublocationDest', 00980 ), 00981 'CreatorContactInfo' => array( 00982 /* Note this maps to 2:118 in iim 00983 * (Contact) field. However those field 00984 * types are slightly different - 2:118 00985 * is free form text field, where this 00986 * is more structured. 00987 */ 00988 'map_group' => 'general', 00989 'mode' => XMPReader::MODE_STRUCT, 00990 'map_name' => 'Contact', 00991 'children' => array( 00992 'CiAdrExtadr' => true, 00993 'CiAdrCity' => true, 00994 'CiAdrCtry' => true, 00995 'CiEmailWork' => true, 00996 'CiTelWork' => true, 00997 'CiAdrPcode' => true, 00998 'CiAdrRegion' => true, 00999 'CiUrlWork' => true, 01000 ), 01001 ), 01002 'CiAdrExtadr' => array( /* address */ 01003 'map_group' => 'general', 01004 'mode' => XMPReader::MODE_SIMPLE, 01005 'structPart'=> true, 01006 ), 01007 'CiAdrCity' => array( /* city */ 01008 'map_group' => 'general', 01009 'mode' => XMPReader::MODE_SIMPLE, 01010 'structPart'=> true, 01011 ), 01012 'CiAdrCtry' => array( /* country */ 01013 'map_group' => 'general', 01014 'mode' => XMPReader::MODE_SIMPLE, 01015 'structPart'=> true, 01016 ), 01017 'CiEmailWork' => array( /* email (possibly separated by ',') */ 01018 'map_group' => 'general', 01019 'mode' => XMPReader::MODE_SIMPLE, 01020 'structPart'=> true, 01021 ), 01022 'CiTelWork' => array( /* telephone */ 01023 'map_group' => 'general', 01024 'mode' => XMPReader::MODE_SIMPLE, 01025 'structPart'=> true, 01026 ), 01027 'CiAdrPcode' => array( /* postal code */ 01028 'map_group' => 'general', 01029 'mode' => XMPReader::MODE_SIMPLE, 01030 'structPart'=> true, 01031 ), 01032 'CiAdrRegion' => array( /* province/state */ 01033 'map_group' => 'general', 01034 'mode' => XMPReader::MODE_SIMPLE, 01035 'structPart'=> true, 01036 ), 01037 'CiUrlWork' => array( /* url. Multiple may be separated by comma. */ 01038 'map_group' => 'general', 01039 'mode' => XMPReader::MODE_SIMPLE, 01040 'structPart'=> true, 01041 ), 01042 /* End contact info struct properties */ 01043 ), 01044 'http://iptc.org/std/Iptc4xmpExt/2008-02-29/' => array( 01045 'Event' => array( 01046 'map_group' => 'general', 01047 'mode' => XMPReader::MODE_SIMPLE, 01048 ), 01049 'OrganisationInImageName' => array( 01050 'map_group' => 'general', 01051 'mode' => XMPReader::MODE_BAG, 01052 'map_name' => 'OrganisationInImage' 01053 ), 01054 'PersonInImage' => array( 01055 'map_group' => 'general', 01056 'mode' => XMPReader::MODE_BAG, 01057 ), 01058 'MaxAvailHeight' => array( 01059 'map_group' => 'general', 01060 'mode' => XMPReader::MODE_SIMPLE, 01061 'validate' => 'validateInteger', 01062 'map_name' => 'OriginalImageHeight', 01063 ), 01064 'MaxAvailWidth' => array( 01065 'map_group' => 'general', 01066 'mode' => XMPReader::MODE_SIMPLE, 01067 'validate' => 'validateInteger', 01068 'map_name' => 'OriginalImageWidth', 01069 ), 01070 // LocationShown and LocationCreated are handled 01071 // specially because they are hierarchical, but we 01072 // also want to merge with the old non-hierarchical. 01073 'LocationShown' => array( 01074 'map_group' => 'special', 01075 'mode' => XMPReader::MODE_BAGSTRUCT, 01076 'children' => array( 01077 'WorldRegion' => true, 01078 'CountryCode' => true, /* iso code */ 01079 'CountryName' => true, 01080 'ProvinceState' => true, 01081 'City' => true, 01082 'Sublocation' => true, 01083 ), 01084 ), 01085 'LocationCreated' => array( 01086 'map_group' => 'special', 01087 'mode' => XMPReader::MODE_BAGSTRUCT, 01088 'children' => array( 01089 'WorldRegion' => true, 01090 'CountryCode' => true, /* iso code */ 01091 'CountryName' => true, 01092 'ProvinceState' => true, 01093 'City' => true, 01094 'Sublocation' => true, 01095 ), 01096 ), 01097 'WorldRegion' => array( 01098 'map_group' => 'special', 01099 'mode' => XMPReader::MODE_SIMPLE, 01100 'structPart'=> true, 01101 ), 01102 'CountryCode' => array( 01103 'map_group' => 'special', 01104 'mode' => XMPReader::MODE_SIMPLE, 01105 'structPart'=> true, 01106 ), 01107 'CountryName' => array( 01108 'map_group' => 'special', 01109 'mode' => XMPReader::MODE_SIMPLE, 01110 'structPart'=> true, 01111 'map_name' => 'Country', 01112 ), 01113 'ProvinceState' => array( 01114 'map_group' => 'special', 01115 'mode' => XMPReader::MODE_SIMPLE, 01116 'structPart'=> true, 01117 'map_name' => 'ProvinceOrState', 01118 ), 01119 'City' => array( 01120 'map_group' => 'special', 01121 'mode' => XMPReader::MODE_SIMPLE, 01122 'structPart'=> true, 01123 ), 01124 'Sublocation' => array( 01125 'map_group' => 'special', 01126 'mode' => XMPReader::MODE_SIMPLE, 01127 'structPart'=> true, 01128 ), 01129 01130 /* Other props that might be interesting but 01131 * Not currently extracted: 01132 * ArtworkOrObject, (info about objects in picture) 01133 * DigitalSourceType 01134 * RegistryId 01135 */ 01136 ), 01137 01138 /* Plus props we might want to consider: 01139 * (Note: some of these have unclear/incomplete definitions 01140 * from the iptc4xmp standard). 01141 * ImageSupplier (kind of like iptc source field) 01142 * ImageSupplierId (id code for image from supplier) 01143 * CopyrightOwner 01144 * ImageCreator 01145 * Licensor 01146 * Various model release fields 01147 * Property release fields. 01148 */ 01149 ); 01150 }