Ignore:
Timestamp:
Oct 31, 2010, 10:48:27 AM (13 years ago)
Author:
grum
Message:

Update JpegMetadata class to implement COM segment as a tag and keywords in "magic" tags
feature:1975, feature:1976

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/JpegMetaData/JpegMetaData.class.php

    r7441 r7511  
    101101 * |         |            |   . add XML <lr:hierarchicalSubject> markup
    102102 * |         |            |
    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
    106108 * |         |            |
    107109 * |         |            |
     
    242244        'maker' => true,
    243245        'magic' => true,
     246        'com'   => true
    244247      );
    245248
     
    275278        $list[]="magic";
    276279
     280      if($default['com'])
     281        $list[]="com";
     282
    277283      foreach($list as $val)
    278284      {
     
    300306            $tmp=new MagicTags();
    301307            $schema=Schemas::MAGIC;
     308            break;
     309          case "com":
     310            $tmp=new ComTags();
     311            $schema=Schemas::COM;
    302312            break;
    303313          case MAKER_PENTAX:
     
    479489              }
    480490            }
     491            elseif($data instanceof ComReader)
     492            {
     493              $this->loadTags($data->getTags(), Schemas::COM);
     494            }
    481495          }
    482496        }
     
    577591        'iptc'  => true,
    578592        'xmp'   => true,
    579         'magic' => true
     593        'magic' => true,
     594        'com'   => true
    580595      );
    581596
     
    676691          foreach($returned[1] as $testKey)
    677692          {
    678             $found=$found & array_key_exists($testKey, $this->tags);
     693            $found=$found & (array_key_exists($testKey, $this->tags) and $this->tags[$testKey]->getValue()!='');
    679694          }
    680695          if(count($returned[1])==0) $found=false;
     
    780795          if($result[4][0]=="W" or $result[4][0]=="S") $num=-$num;
    781796          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;
    782802        default:
    783803          return($value);
Note: See TracChangeset for help on using the changeset viewer.