Changeset 1029 for trunk/tools
- Timestamp:
- Feb 8, 2006, 2:17:07 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/create_listing_file.php
r1020 r1029 45 45 $conf['version'] = '%PWGVERSION%'; 46 46 47 // $conf['use_exif'] set to true if you want to use Exif Date as "creation 48 // date" for the element, otherwise, set to false 47 // $conf['use_exif'] set to true if you want to use Exif information 49 48 $conf['use_exif'] = true; 49 50 // use_exif_mapping: same behaviour as use_iptc_mapping 51 $conf['use_exif_mapping'] = array( 52 'date_creation' => 'DateTimeOriginal' 53 ); 50 54 51 55 // $conf['use_iptc'] set to true if you want to use IPTC informations of the … … 321 325 if ($file != '.' 322 326 and $file != '..' 327 and $file != '.svn' 323 328 and $file != 'thumbnail' 324 329 and $file != 'pwg_high' … … 345 350 $dirs.= "\n".$indent.'</dir'.$level.'>'; 346 351 } 347 return $dirs; 352 return $dirs; 348 353 } 349 354 … … 426 431 if ($exif = @read_exif_data($dir.'/'.$fs_file)) 427 432 { 428 if (isset($exif['DateTime']))433 foreach ($conf['use_exif_mapping'] as $pwg_key => $exif_key ) 429 434 { 430 preg_match('/^(\d{4}):(\d{2}):(\d{2})/' 431 ,$exif['DateTime'] 432 ,$matches); 433 $element['date_creation'] = 434 $matches[1].'-'.$matches[2].'-'.$matches[3]; 435 if (isset($exif[$exif_key])) 436 { 437 if ( in_array($pwg_key, array('date_creation','date_available') ) ) 438 { 439 if (preg_match('/^(\d{4}):(\d{2}):(\d{2})/' 440 ,$exif[$exif_key] 441 ,$matches)) 442 { 443 $element[$pwg_key] = 444 $matches[1].'-'.$matches[2].'-'.$matches[3]; 445 } 446 } 447 else 448 { 449 $element[$pwg_key] = $exif[$exif_key]; 450 } 451 } 435 452 } 436 453 } … … 525 542 $listing.= ' generation_date="'.date('Y-m-d').'"'; 526 543 $listing.= ' phpwg_version="'.$conf{'version'}.'"'; 544 545 $attrs=array(); 546 if ($conf['use_iptc']) 547 { 548 $attrs = array_merge($attrs, array_keys($conf['use_iptc_mapping']) ); 549 } 550 if ($conf['use_exif']) 551 { 552 $attrs = array_merge($attrs, array_keys($conf['use_exif_mapping']) ); 553 } 554 $listing.= ' metadata="'.implode(',',array_unique($attrs)).'"'; 527 555 528 556 $end = strrpos($_SERVER['PHP_SELF'], '/') + 1;
Note: See TracChangeset
for help on using the changeset viewer.