Ignore:
Timestamp:
Jan 17, 2010, 7:05:35 PM (14 years ago)
Author:
grum
Message:

[Plugin:AMetaData] Finished to comment the JpegMetaData classes and rename some methods

File:
1 edited

Legend:

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

    r4686 r4698  
    111111    /**
    112112     * returns a Tag object from a sequential index
     113     * return null if index is out of range
    113114     *
    114115     * @return Tag
     
    116117    public function getTag($index)
    117118    {
    118       return($this->entries[$index]);
     119      if($index>=0 and $index<=count($this->entries))
     120        return($this->entries[$index]);
     121      else
     122        return(null);
    119123    }
    120124
     
    140144      for($i=0;$i<count($this->entries);$i++)
    141145      {
    142         if($this->entries[$i]->getId()==$tagId)
    143         {
    144           return($i);
     146        if($this->entries[$i] instanceof IfdEntryReader)
     147        {
     148          if($this->entries[$i]->getTagId()==$tagId)
     149          {
     150            return($i);
     151          }
     152        }
     153        elseif($this->entries[$i] instanceof Tag)
     154        {
     155          if($this->entries[$i]->getId()==$tagId)
     156          {
     157            return($i);
     158          }
    145159        }
    146160      }
     
    176190      for($i=0;$i<count($this->entries);$i++)
    177191      {
    178         if($this->entries[$i]->getName()==$name)
    179         {
    180           return($this->entries[$i]);
     192        if($this->entries[$i] instanceof IfdEntryReader)
     193        {
     194          if($this->entries[$i]->getTag()->getName()==$name)
     195          {
     196            return($this->entries[$i]->getTag());
     197          }
     198        }
     199        elseif($this->entries[$i] instanceof Tag)
     200        {
     201          if($this->entries[$i]->getName()==$name)
     202          {
     203            return($this->entries[$i]);
     204          }
    181205        }
    182206      }
Note: See TracChangeset for help on using the changeset viewer.