Changeset 7511 for extensions/AMetaData/JpegMetaData
- Timestamp:
- Oct 31, 2010, 10:48:27 AM (14 years ago)
- Location:
- extensions/AMetaData/JpegMetaData
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMetaData/JpegMetaData/Common/Const.class.php
r6729 r7511 147 147 const XMP = "xmp"; 148 148 const MAGIC = "magic"; 149 const COM = "com"; 149 150 150 151 const EXIF_TIFF = "exif.tiff"; -
extensions/AMetaData/JpegMetaData/JpegMetaData.class.php
r7441 r7511 101 101 * | | | . add XML <lr:hierarchicalSubject> markup 102 102 * | | | 103 * | | | 104 * | | | 105 * | | | 103 * | | | * mantis bug:1975 104 * | | | . Implement COM segment as a tag 105 * | | | 106 * | | | * mantis bug:1976 107 * | | | . Implement keywords as magic tag 106 108 * | | | 107 109 * | | | … … 242 244 'maker' => true, 243 245 'magic' => true, 246 'com' => true 244 247 ); 245 248 … … 275 278 $list[]="magic"; 276 279 280 if($default['com']) 281 $list[]="com"; 282 277 283 foreach($list as $val) 278 284 { … … 300 306 $tmp=new MagicTags(); 301 307 $schema=Schemas::MAGIC; 308 break; 309 case "com": 310 $tmp=new ComTags(); 311 $schema=Schemas::COM; 302 312 break; 303 313 case MAKER_PENTAX: … … 479 489 } 480 490 } 491 elseif($data instanceof ComReader) 492 { 493 $this->loadTags($data->getTags(), Schemas::COM); 494 } 481 495 } 482 496 } … … 577 591 'iptc' => true, 578 592 'xmp' => true, 579 'magic' => true 593 'magic' => true, 594 'com' => true 580 595 ); 581 596 … … 676 691 foreach($returned[1] as $testKey) 677 692 { 678 $found=$found & array_key_exists($testKey, $this->tags);693 $found=$found & (array_key_exists($testKey, $this->tags) and $this->tags[$testKey]->getValue()!=''); 679 694 } 680 695 if(count($returned[1])==0) $found=false; … … 780 795 if($result[4][0]=="W" or $result[4][0]=="S") $num=-$num; 781 796 return($num); 797 case "Author.Keywords": 798 $list=array_flip(array_flip(explode(',', str_replace(array('/', '|', ', '), ',', $value)))); 799 sort($list); 800 return(implode(',', $list)); 801 break; 782 802 default: 783 803 return($value); -
extensions/AMetaData/JpegMetaData/Locale/en_UK/Tag.po
r5789 r7511 3 3 "Project-Id-Version: TagNames\n" 4 4 "POT-Creation-Date: \n" 5 "PO-Revision-Date: 2010- 04-11 09:31+0100\n"5 "PO-Revision-Date: 2010-10-31 01:25+0100\n" 6 6 "Last-Translator: grum <grum@piwigo.org>\n" 7 7 "Language-Team: grum\n" … … 285 285 msgid "Author.ImageTitle" 286 286 msgstr "Title" 287 288 #. [Metadata name] Magic JpegMetadata computed tags / Author.Keywords 289 msgid "Author.Keywords" 290 msgstr "Keywords/Subject" 287 291 288 292 #. Canon specific tags / 0x0001.4 (CanonCameraSettings.CanonFlashMode) … … 6412 6416 msgstr "Y resolution" 6413 6417 6418 #. [Metadata name] XMP tags / digiKam:TagsList 6419 msgid "digiKam:TagsList" 6420 msgstr "Keywords/Subject" 6421 6422 #. [Metadata name] XMP tags / lr:hierarchicalSubject 6423 msgid "lr:hierarchicalSubject" 6424 msgstr "Keywords/Subject" 6425 6426 #. [Metadata name] IPTC tags / 0x20c04 (Subject Reference[Detail Name]) 6427 msgid "Subject Reference[Detail Name]" 6428 msgstr "Subject Reference (Detail name)" 6429 6430 #. [Metadata name] IPTC tags / 0x20c00 (Subject Reference[IPR]) 6431 msgid "Subject Reference[IPR]" 6432 msgstr "Subject Reference (IPR)" 6433 6434 #. [Metadata name] IPTC tags / 0x20c03 (Subject Reference[Matter Name]) 6435 msgid "Subject Reference[Matter Name]" 6436 msgstr "Subject Reference (Matter Name)" 6437 6438 #. [Metadata name] IPTC tags / 0x20c02 (Subject Reference[Name]) 6439 msgid "Subject Reference[Name]" 6440 msgstr "Subject Reference (Name)" 6441 6442 #. [Metadata name] IPTC tags / 0x20c01 (Subject Reference[Number]) 6443 msgid "Subject Reference[Number]" 6444 msgstr "Subject Reference (Number)" 6445 -
extensions/AMetaData/JpegMetaData/Locale/fr_FR/Tag.po
r5789 r7511 3 3 "Project-Id-Version: TagNames\n" 4 4 "POT-Creation-Date: \n" 5 "PO-Revision-Date: 2010- 04-11 10:00+0100\n"5 "PO-Revision-Date: 2010-10-31 01:13+0100\n" 6 6 "Last-Translator: grum <grum@piwigo.org>\n" 7 7 "Language-Team: grum\n" … … 289 289 msgid "Author.ImageTitle" 290 290 msgstr "Titre" 291 292 #. [Metadata name] Magic JpegMetadata computed tags / Author.Keywords 293 msgid "Author.Keywords" 294 msgstr "Mots clefs" 291 295 292 296 #. Canon specific tags / 0x0001.4 (CanonCameraSettings.CanonFlashMode) … … 6561 6565 msgstr "Résolution Y" 6562 6566 6567 #. [Metadata name] XMP tags / digiKam:TagsList 6568 msgid "digiKam:TagsList" 6569 msgstr "Mots clefs" 6570 6571 #. [Metadata name] XMP tags / lr:hierarchicalSubject 6572 msgid "lr:hierarchicalSubject" 6573 msgstr "Mots clefs" 6574 6575 #. [Metadata name] IPTC tags / 0x20c04 (Subject Reference[Detail Name]) 6576 msgid "Subject Reference[Detail Name]" 6577 msgstr "Sujet de référence (nom détaillé)" 6578 6579 #. [Metadata name] IPTC tags / 0x20c00 (Subject Reference[IPR]) 6580 msgid "Subject Reference[IPR]" 6581 msgstr "Sujet de référence (IPR)" 6582 6583 #. [Metadata name] IPTC tags / 0x20c03 (Subject Reference[Matter Name]) 6584 msgid "Subject Reference[Matter Name]" 6585 msgstr "Sujet de référence (matière)" 6586 6587 #. [Metadata name] IPTC tags / 0x20c02 (Subject Reference[Name]) 6588 msgid "Subject Reference[Name]" 6589 msgstr "Sujet de référence (nom)" 6590 6591 #. [Metadata name] IPTC tags / 0x20c01 (Subject Reference[Number]) 6592 msgid "Subject Reference[Number]" 6593 msgstr "Sujet de référence (numéro)" 6594 -
extensions/AMetaData/JpegMetaData/Readers/AppMarkerSegmentReader.class.php
r4972 r7511 73 73 require_once(JPEG_METADATA_DIR."Readers/XmpReader.class.php"); 74 74 require_once(JPEG_METADATA_DIR."Readers/IptcReader.class.php"); 75 require_once(JPEG_METADATA_DIR."Readers/ComReader.class.php"); 75 76 76 77 class AppMarkerSegmentReader … … 922 923 private function readSegmentCOM() 923 924 { 924 $this->data = $this->workData->readASCII();925 $this->data = new ComReader($this->workData->readASCII()); 925 926 $this->dataLoaded=true; 926 927 } -
extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php
r6986 r7511 254 254 "{iptc.Caption/Abstract}", 255 255 "{exif.exif.UserComment}", 256 "{com.comment}" 257 ) 258 ), 259 260 'Author.Keywords' => Array( 261 'implemented' => true, 262 'translatable' => false, 263 'tagValues' => Array( 264 "{xmp.dc:subject[values]},{iptc.Keywords[values]},{xmp.digiKam:TagsList[values]},{xmp.lr:hierarchicalSubject[values]}" 256 265 ) 257 266 ), -
extensions/AMetaData/JpegMetaData/test/index.php
r5222 r7511 74 74 7 => "808000", 75 75 8 => "800080", 76 9 => "808080"); 76 9 => "808080", 77 10 => "6080F0", 78 11 => "F06080", 79 12 => "80F060", 80 13 => "8080FF", 81 14 => "80FF80", 82 15 => "FF8080" ); 77 83 78 84 $parser = xml_parser_create(); … … 237 243 $page.="<span style='font-family:monospace;'>"; 238 244 239 $jpeg = new JpegReader($file );245 $jpeg = new JpegReader($file, Array('filter' => JpegMetaData::TAGFILTER_ALL, 'xmp' => false, 'maker' => false, 'iptc' => false, 'exif' => false)); 240 246 241 247 $page2="JpegReader extraction<br>"; … … 286 292 } 287 293 } 294 elseif($data instanceof ComReader) 295 { 296 foreach($data->getTags() as $key2 => $val2) 297 { 298 $page2.="<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>"; 299 $page2.=dump_tag($key2, $val2, ""); 300 $page2.="</div>"; 301 } 302 } 288 303 elseif(is_array($data)) 289 304 { … … 303 318 $page2.="<div style='font-family:monospace;'>JpegMetaData - tag from test file<br>"; 304 319 $page2.="<table style='border:1px solid #000000;width:100%;'>"; 305 $page2.="<tr style='border-bottom:1x solid #000000;'><th> Key</th><th>Name</th><th>Value</th><th>Computed Value</th></tr>";320 $page2.="<tr style='border-bottom:1x solid #000000;'><th>Schema</th><th>Key</th><th>Name</th><th>Value</th><th>Computed Value</th></tr>"; 306 321 307 322 308 323 $time=microtime(true); 309 $jpegmd = new JpegMetaData($file, Array( 310 'filter' => JpegMetaData::TAGFILTER_IMPLEMENTED, 311 'optimizeIptcDateTime' => true) 312 ); 324 $jpegmd = new JpegMetaData($file, 325 Array( 326 'filter' => JpegMetaData::TAGFILTER_IMPLEMENTED, 327 'xmp' => true, 328 'maker' => true, 329 'iptc' => true, 330 'magic' => true, 331 'exif' => true, 332 'optimizeIptcDateTime' => true 333 ) 334 ); 313 335 $time2=microtime(true); 314 336 … … 332 354 if(is_array($value)) 333 355 $value=print_r($value, true); 334 $page2.="<tr><td>".$ key."</td><td>".L10n::get($val->getName())."</td><td>".$value."</td><td style='$style'>".$txt."</td></tr>";356 $page2.="<tr><td>".$val->getSchema()."</td><td>".$key."</td><td>".L10n::get($val->getName())."</td><td>".$value."</td><td style='$style'>".$txt."</td></tr>"; 335 357 $i++; 336 358 } … … 342 364 $page2.="<table style='border:1px solid #000000;width:100%;'>"; 343 365 $page2.="<tr style='border-bottom:1x solid #000000;'><th>Key</th><th>Name</th><th>Implemented</th></tr>"; 344 foreach(JpegMetaData::getTagList(Array('filter' => JpegMetaData::TAGFILTER_ALL, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val) 366 foreach(JpegMetaData::getTagList( 367 Array( 368 'filter' => JpegMetaData::TAGFILTER_ALL, 369 'xmp' => true, 370 'maker' => true, 371 'iptc' => true, 372 'magic' => true, 373 'exif' => true, 374 ) 375 ) as $key => $val) 345 376 { 346 377 $val['implemented']?$i++:$j++;
Note: See TracChangeset
for help on using the changeset viewer.