Index: /extensions/AMetaData/JpegMetaData/Common/Locale.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Common/Locale.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Common/Locale.class.php	(revision 4698)
@@ -35,6 +35,38 @@
  * The Locale class is used for tag translation, reading the .mo files
  *
+ * There is one directory per language, the directories tree must respect this
+ * structure
+ *
+ * --\ Locale                           => main directory for languages
+ *     |
+ *     +--\ en_UK                       => language
+ *     |    |
+ *     |    +--\ LC_MESSAGES
+ *     |         |
+ *     |         +--\ Tag.mo            => names & values translations
+ *     |         +--\ TadDesc.mo        => descriptions translations
+ *     |
+ *     +--\ fr_FR
+ *          |
+ *          +--\ LC_MESSAGES
+ *               |
+ *               +--\ Tag.mo
+ *               +--\ TadDesc.mo
+ *
+ *
  * -----------------------------------------------------------------------------
  *
+ * .. Notes ..
+ *
+ * This class don't use the PHP gettext functions, but the php-gettext extension
+ * ==> See files in External/php-gettext for more information about this project
+ *
+ *
+ *
+ * This class provides theses public functions :
+ *  - (static) setLanguage
+ *  - (static) getLanguage
+ *  - (static) get
+ *  - (static) getDesc
  *
  * -----------------------------------------------------------------------------
@@ -44,5 +76,15 @@
 require_once(JPEG_METADATA_DIR."External/php-gettext/gettext.inc");
 
-$supported_locales = array('en_UK');
+/**
+ * $supported_locales is a global variable need by the php-gettext package.
+ * the array is automatically initialized with the setLanguage() function
+ */
+$supported_locales = array();
+
+/**
+ * assume a default language is set in any case...
+ */
+Locale::setLanguage();
+
 
 class Locale
@@ -51,17 +93,85 @@
   const JMD_TAGDESC = "TagDesc";
 
-  static function set($language)
+  static private $language = "";
+
+  /**
+   * This function is used to set the locale language.
+   * If no language is given, assume the default "en_UK" language
+   *
+   * If there is no translation file for the the given language, assume the
+   * default "en_UK" language
+   *
+   * @param String $language : the language
+   * @return String : the defined language
+   */
+  static function setLanguage($language="en_UK")
   {
-    T_setlocale(LC_MESSAGES, $language);
+    global $supported_locales;
 
+    /*
+     * Scan the Locale directory.
+     * Any directory with a sub directory "LC_MESSAGES" is considered as a
+     * supported locale language
+     */
+    $directory=scandir(JPEG_METADATA_DIR."Locale");
+    foreach($directory as $key => $file)
+    {
+      if(is_dir(JPEG_METADATA_DIR."Locale/".$file) and
+         $file!='.' and
+         $file!='..' and
+         file_exists(JPEG_METADATA_DIR."Locale/".$file."/LC_MESSAGES/Tag.mo"))
+         $supported_locales[]=$file;
+
+    }
+
+    /*
+     * if the desired language doesn't exist, apply the en_UK locale
+     * (assuming the en_UK exists and was not deleted)
+     */
+    if(!in_array($language, $supported_locales))
+      self::$language='en_UK';
+    else
+      self::$language=$language;
+
+    /*
+     * set the locale
+     */
+    T_setlocale(LC_MESSAGES, self::$language);
+
+    /*
+     * set one domain "TAG" for tags name&values, and one domaine "TAGDESC" for
+     * tags description
+     */
     T_bindtextdomain(self::JMD_TAG, dirname(dirname(__FILE__))."/Locale");
     T_bindtextdomain(self::JMD_TAGDESC, dirname(dirname(__FILE__))."/Locale");
+
+    return(self::$language);
   }
 
-  static function get($tagName)
+  /**
+   * returns the defined current language
+   *
+   * @return String
+   */
+  static function getLanguage()
   {
-    return(@T_dgettext(self::JMD_TAG, $tagName));
+    return(self::$language);
   }
 
+  /**
+   * returns the translation in current language for the given key
+   *
+   * @return String
+   */
+  static function get($key)
+  {
+    return(@T_dgettext(self::JMD_TAG, $key));
+  }
+
+  /**
+   * returns the description in current language for the given tagName
+   *
+   * @return String
+   */
   static function getDesc($tagName)
   {
Index: /extensions/AMetaData/JpegMetaData/Common/Tag.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Common/Tag.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Common/Tag.class.php	(revision 4698)
@@ -58,16 +58,16 @@
  *  - getValue
  *  - getLabel
- *  - getIsKnown
- *  - getIsImplemented
  *  - getNote
- *  - getIsTranslatable
+ *  - isKnown
+ *  - isImplemented
+ *  - isTranslatable
  *  - setId
  *  - setName
  *  - setValue
  *  - setLabel
- *  - setIsKnown
- *  - setIsImplemented
  *  - setNote
- *  - setIsTranslatable
+ *  - setKnown
+ *  - setImplemented
+ *  - setTranslatable
  *
  * -----------------------------------------------------------------------------
@@ -164,5 +164,5 @@
      * @return Boolean
      */
-    public function getIsKnown()
+    public function isKnown()
     {
       return($this->tagIsKnown);
@@ -174,5 +174,5 @@
      * @return Boolean
      */
-    public function getIsImplemented()
+    public function isImplemented()
     {
       return($this->tagIsImplemented);
@@ -194,5 +194,5 @@
      * @return Boolean
      */
-    public function getIsTranslatable()
+    public function isTranslatable()
     {
       return($this->tagIsTranslatable);
@@ -207,5 +207,5 @@
     public function setId($value)
     {
-      if($value>=0x0000 and $value <= 0xffff) $this->tagId=$value;
+      $this->tagId=$value;
       return($this->tagId);
     }
@@ -253,5 +253,5 @@
      * @return Boolean
      */
-    public function setIsKnown($value)
+    public function setKnown($value)
     {
       $this->tagIsKnown=($value===true)?true:false;
@@ -265,5 +265,5 @@
      * @return Boolean
      */
-    public function setIsImplemented($value)
+    public function setImplemented($value)
     {
       $this->tagIsImplemented=($value===true)?true:false;
@@ -289,5 +289,5 @@
      * @return Boolean
      */
-    public function setIsTranslatable($value)
+    public function setTranslatable($value)
     {
       $this->tagIsTranslatable=($value===true)?true:false;
Index: /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php	(revision 4698)
@@ -433,5 +433,5 @@
       foreach($this->tags as $key => $val)
       {
-        if(self::filter($val->getIsKnown(), $val->getIsImplemented(), $tagFilter))
+        if(self::filter($val->isKnown(), $val->isImplemented(), $tagFilter))
         {
           $returned[$key]=$val;
@@ -477,5 +477,5 @@
       foreach($ifd->getTags() as $key => $tag)
       {
-        if(self::filter($tag->getTag()->getIsKnown(), $tag->getTag()->getIsImplemented(), $this->options['filter']))
+        if(self::filter($tag->getTag()->isKnown(), $tag->getTag()->isImplemented(), $this->options['filter']))
         {
           if($tag->getTag()->getLabel() instanceof IfdReader)
@@ -519,5 +519,5 @@
       foreach($tags as $key => $tag)
       {
-        if(self::filter($tag->getIsKnown(), $tag->getIsImplemented(), $this->options['filter']))
+        if(self::filter($tag->isKnown(), $tag->isImplemented(), $this->options['filter']))
         {
           $this->tags[$tagKey.".".$tag->getName()]=$tag;
Index: /extensions/AMetaData/JpegMetaData/Locale/en_UK/Tag.po
===================================================================
--- /extensions/AMetaData/JpegMetaData/Locale/en_UK/Tag.po	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Locale/en_UK/Tag.po	(revision 4698)
@@ -1277,5 +1277,5 @@
 #. Pentax specific tags / 0x000e (AFPoint)
 msgid "Left"
-msgstr "****Left"
+msgstr "Left"
 
 #. Pentax specific tags / 0x0207 (LensInfo)
Index: /extensions/AMetaData/JpegMetaData/Readers/GenericReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/GenericReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/GenericReader.class.php	(revision 4698)
@@ -111,4 +111,5 @@
     /**
      * returns a Tag object from a sequential index
+     * return null if index is out of range
      *
      * @return Tag
@@ -116,5 +117,8 @@
     public function getTag($index)
     {
-      return($this->entries[$index]);
+      if($index>=0 and $index<=count($this->entries))
+        return($this->entries[$index]);
+      else
+        return(null);
     }
 
@@ -140,7 +144,17 @@
       for($i=0;$i<count($this->entries);$i++)
       {
-        if($this->entries[$i]->getId()==$tagId)
-        {
-          return($i);
+        if($this->entries[$i] instanceof IfdEntryReader)
+        {
+          if($this->entries[$i]->getTagId()==$tagId)
+          {
+            return($i);
+          }
+        }
+        elseif($this->entries[$i] instanceof Tag)
+        {
+          if($this->entries[$i]->getId()==$tagId)
+          {
+            return($i);
+          }
         }
       }
@@ -176,7 +190,17 @@
       for($i=0;$i<count($this->entries);$i++)
       {
-        if($this->entries[$i]->getName()==$name)
-        {
-          return($this->entries[$i]);
+        if($this->entries[$i] instanceof IfdEntryReader)
+        {
+          if($this->entries[$i]->getTag()->getName()==$name)
+          {
+            return($this->entries[$i]->getTag());
+          }
+        }
+        elseif($this->entries[$i] instanceof Tag)
+        {
+          if($this->entries[$i]->getName()==$name)
+          {
+            return($this->entries[$i]);
+          }
         }
       }
Index: /extensions/AMetaData/JpegMetaData/Readers/HeightBIMReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/HeightBIMReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/HeightBIMReader.class.php	(revision 4698)
@@ -55,4 +55,5 @@
  *  - getSize
  *  - getBlockSize
+ *  - getName
  *
  * -----------------------------------------------------------------------------
Index: /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php	(revision 4698)
@@ -219,8 +219,8 @@
         $tag=$this->tagDef->getTagById($entry->getTagId());
 
-        $entry->getTag()->setIsKnown(true);
+        $entry->getTag()->setKnown(true);
         $entry->getTag()->setName($tag['tagName']);
-        $entry->getTag()->setIsImplemented($tag['implemented']);
-        $entry->getTag()->setIsTranslatable($tag['translatable']);
+        $entry->getTag()->setImplemented($tag['implemented']);
+        $entry->getTag()->setTranslatable($tag['translatable']);
 
         /*
Index: /extensions/AMetaData/JpegMetaData/Readers/IptcReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/IptcReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/IptcReader.class.php	(revision 4698)
@@ -220,8 +220,8 @@
         $tagProperties=$this->tagDef->getTagById($tag->getId());
 
-        $tag->setIsKnown(true);
+        $tag->setKnown(true);
         $tag->setName($tagProperties['tagName']);
-        $tag->setIsImplemented($tagProperties['implemented']);
-        $tag->setIsTranslatable($tagProperties['translatable']);
+        $tag->setImplemented($tagProperties['implemented']);
+        $tag->setTranslatable($tagProperties['translatable']);
 
         /*
Index: /extensions/AMetaData/JpegMetaData/Readers/MakerNotesReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/MakerNotesReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/MakerNotesReader.class.php	(revision 4698)
@@ -33,6 +33,13 @@
  * -----------------------------------------------------------------------------
  *
- * The MakerNotesReader class is dedicated to read tags from the maker note sub
- * IFD structure
+ * The exif tag 0x927C "MakerNote" is a tag used by the camera maker to manage
+ * their own data.
+ *
+ * In most of case, this tags gives an offset to an extra data block.
+ * And in most of case, this data block is a sub-IFD block
+ *
+ * The MakerNotesReader is a generic class dedicated to read tags from the maker
+ * note sub IFD structure
+ *
  *
  * ======> See IfdReader.class.php to know more about an IFD structure <========
Index: /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php	(revision 4698)
@@ -9,11 +9,46 @@
  *   << May the Little SpaceFrog be with you ! >>
  *
+ *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
  *
+ * The PentaxReader class is the dedicated to read the specific Pentax tags
+ *
+ * ====> See MakerNotesReader.class.php to know more about the structure <======
+ *
  * -----------------------------------------------------------------------------
- * Pentax reader class
+ *
+ * .. Notes ..
+ *
+ *
+ * The PentaxReader class is derived from the MakerNotesReader class.
+ *
+ * ======> See MakerNotesReader.class.php to know more about common methods <======
+ *
  * -----------------------------------------------------------------------------
  */
 
+
+
   require_once(JPEG_METADATA_DIR."TagDefinitions/PentaxTags.class.php");
   require_once(JPEG_METADATA_DIR."Readers/MakerNotesReader.class.php");
@@ -21,4 +56,21 @@
   class PentaxReader extends MakerNotesReader
   {
+    /**
+     * The constructor needs, like the ancestor, the datas to be parsed
+     *
+     * Some datas are offset on extra data, and this offset can be (some time)
+     * absolute inside the IFD, or relative. So, the offset of the IFD structure
+     * is needed
+     *
+     * The byte order can be different from the TIFF byte order !
+     *
+     * The constructor need the maker signature (see the MakerNotesSignatures
+     * class for a list of known signatures)
+     *
+     * @param String $data
+     * @param ULong $offset : offset of IFD block in the jpeg file
+     * @param String $byteOrder
+     * @param String $makerSignature :
+     */
     function __construct($data, $offset, $byteOrder, $makerSignature)
     {
@@ -39,4 +91,8 @@
     }
 
+
+    /**
+     * initialize the definition for Pentax exif tags
+     */
     protected function initializeTagDef()
     {
@@ -44,4 +100,7 @@
     }
 
+    /**
+     * skip the IFD header
+     */
     protected function skipHeader($headerSize=0)
     {
@@ -49,4 +108,15 @@
     }
 
+    /**
+     * this function do the interpretation of specials tags
+     *
+     * the function return the interpreted value for the tag
+     *
+     * @param $tagId             : the id of the tag
+     * @param $values            : 'raw' value to be interpreted
+     * @param UByte $type        : if needed (for IFD structure) the type of data
+     * @param ULong $valueOffset : if needed, the offset of data in the jpeg file
+     * @return String or Array or DateTime or Integer or Float...
+     */
     protected function processSpecialTag($tagId, $values, $type, $valuesOffset=0)
     {
@@ -172,4 +242,10 @@
           $returned=53190 -$values;
           break;
+
+        /* theses tags decoding is not yet implemented
+         * have to take a look on the algorithm in exiftool (it seems to work
+         * but I don't understand everything...)
+         */
+
         case 0x0205: // "ShotInfo",
         case 0x0206: // "AEInfo",
@@ -192,8 +268,4 @@
         case 0x0222: // "ColorInfo",
 
-        /* theses tags decoding is not yet implemented
-         * have to take a look on the algorithm in exiftool (it seems to work
-         * but I don't understand everything...)
-         */
         case 0x0029: // "FrameNumber",
         case 0x0041: // "DigitalFilter",
@@ -207,12 +279,8 @@
           $returned="Not yet implemented;".ConvertData::toHexDump($tagId, ByteType::USHORT)." => ".ConvertData::toHexDump($values, $type);
           break;
-
       }
-
       return($returned);
     }
-
   }
 
-
 ?>
Index: /extensions/AMetaData/JpegMetaData/Readers/SegmentReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/SegmentReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/SegmentReader.class.php	(revision 4698)
@@ -9,8 +9,45 @@
  *   << May the Little SpaceFrog be with you ! >>
  *
- * -----------------------------------------------------------------------------
+ *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
  *
  *
  * -----------------------------------------------------------------------------
+ *
+ * The SegmentReader is a generic class providing methods to manage datas
+ * segments
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ * This class is not declared as an abstract class, but it's not recommanded to
+ * create object with it.
+ *
+ *
+ * Derived classes :
+ *  - TiffReader        (for Tiff data block)
+ *
+ * This class provides theses public functions :
+ *  - getIsValid
+ *  - getIsLoaded
  *
  * -----------------------------------------------------------------------------
@@ -23,4 +60,9 @@
     protected $isLoaded = false;
 
+    /**
+     * The constructor need the segment's datas
+     *
+     * @param Data $data : a Data object
+     */
     function __construct(Data $data)
     {
@@ -29,4 +71,9 @@
     }
 
+    /**
+     * return true if the segment is valid
+     *
+     * @return Boolean
+     */
     public function getIsValid()
     {
@@ -34,4 +81,9 @@
     }
 
+    /**
+     * return true if the segment is loaded
+     *
+     * @return Boolean
+     */
     public function getIsLoaded()
     {
Index: /extensions/AMetaData/JpegMetaData/Readers/TiffReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/TiffReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/TiffReader.class.php	(revision 4698)
@@ -9,11 +9,56 @@
  *   << May the Little SpaceFrog be with you ! >>
  *
- * -----------------------------------------------------------------------------
+ *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
  *
  *
  * -----------------------------------------------------------------------------
  *
+ * The TiffReader class is the dedicated to read a TIFF structure
+ *
+ * A Tiff structure is formatted as this :
+ *  - byte order            : 2 bytes, "II" or "MM", indicates the byte order
+ *  - header tag            : 2 bytes, UShort equals 0x002a
+ *  - first IFD offset      : 4 bytes, ULong
+ *  - IFDs                  :
+ *
+ * => See IfdReader.class.php & IfdEntryReader.class.php to know more on IFD <==
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ *
+ * The TiffReader class is derived from the SegmentReader class.
+ *
+ * ======> See SegmentReader.class.php to know more about common methods <======
+ *
+ *
+ * This class provides theses public functions :
+ *  - getNbIFDs
+ *  - getIFDs
+ *  - getIFD
+ *
  * -----------------------------------------------------------------------------
  */
+
 
   require_once(JPEG_METADATA_DIR."Common/ConvertData.class.php");
@@ -29,4 +74,11 @@
     private $firstIFDOffset = 0;
 
+    /**
+     * The constructor need the Tiff block datas (given as a Data object) and
+     * offset of the TIFF block inside the jpeg file
+     *
+     * @param Data $data :
+     * @param ULong $offsetData (optional) :
+     */
     function __construct(Data $data, $offsetData=0)
     {
@@ -48,5 +100,5 @@
 
         $header=$this->data->readUShort();
-        if($header==0x2a)
+        if($header==0x002a)
         {
           $this->isValid=true;
@@ -62,16 +114,9 @@
     }
 
-    private function readData()
-    {
-      $nextIFD = $this->firstIFDOffset;
-      while($nextIFD!=0)
-      {
-        $this->data->seek($nextIFD);
-        $IFD = new IfdReader($this->data->readASCII(), $nextIFD, $this->byteOrder);
-        $this->IFDs[]=$IFD;
-        $nextIFD = $IFD->getNextIFDOffset();
-      }
-    }
-
+    /**
+     * return the number of IFDs found in the Tiff block
+     *
+     * @return Integer
+     */
     public function getNbIFDs()
     {
@@ -79,4 +124,9 @@
     }
 
+    /**
+     * return an array of IFD found in the the Tiff block
+     *
+     * @return IFD[]
+     */
     public function getIFDs()
     {
@@ -84,4 +134,10 @@
     }
 
+    /**
+     * returns a specific IFD
+     *
+     * @param Integer $num : index of the needed IFD
+     * @return IFD
+     */
     public function getIFD($num)
     {
@@ -91,5 +147,4 @@
         return(null);
     }
-
 
     public function toString()
@@ -104,4 +159,25 @@
     }
 
+    /**
+     * The readData function read IFDs from the Tiff block, and add them into
+     * the IFDs array
+     */
+    private function readData()
+    {
+      $nextIFD = $this->firstIFDOffset;
+      /*
+       * while the next IFD offset is not zero, read the IFD at the designed
+       * offset
+       *
+       * the next IFD offset is given at the end of the last IFD read.
+       */
+      while($nextIFD!=0)
+      {
+        $this->data->seek($nextIFD);
+        $IFD = new IfdReader($this->data->readASCII(), $nextIFD, $this->byteOrder);
+        $this->IFDs[]=$IFD;
+        $nextIFD = $IFD->getNextIFDOffset();
+      }
+    }
   }
 
Index: /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php	(revision 4698)
@@ -295,7 +295,7 @@
         $tagProperties=$this->tagDef->getTagById($name);
 
-        $tag->setIsKnown(true);
-        $tag->setIsImplemented($tagProperties['implemented']);
-        $tag->setIsTranslatable($tagProperties['translatable']);
+        $tag->setKnown(true);
+        $tag->setImplemented($tagProperties['implemented']);
+        $tag->setTranslatable($tagProperties['translatable']);
 
 
Index: tensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php.bak
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php.bak	(revision 4697)
+++ 	(revision )
@@ -1,621 +1,0 @@
-<?php
-/*
- * --:: JPEG MetaDatas ::-------------------------------------------------------
- *
- *  Author    : Grum
- *   email    : grum at piwigo.org
- *   website  : http://photos.grum.fr
- *
- *   << May the Little SpaceFrog be with you ! >>
- *
- * -----------------------------------------------------------------------------
- *
- *
- * -----------------------------------------------------------------------------
- * a voir sil n'est pas plus judicieux de dériver cette classe de GenericReader
- * plutôt que SegmentReader
- * -----------------------------------------------------------------------------
- */
-
-  require_once(JPEG_METADATA_DIR."Common/Data.class.php");
-  require_once(JPEG_METADATA_DIR."Common/XmlData.class.php");
-  require_once(JPEG_METADATA_DIR."Readers/SegmentReader.class.php");
-  require_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php");
-
-  class XmpReader extends SegmentReader
-  {
-    private $xml = "";
-    private $xmlData = NULL;
-    private $tags = Array();
-
-    private $tagDef = null;
-
-    private $xmpTag2Exif = NULL;
-
-    function __construct(Data $data)
-    {
-      parent::__construct($data);
-
-      $this->xml=explode("\x00", $data->readASCII());
-      if(count($this->xml)>1)
-      {
-        $this->xml=$this->xml[1];
-      }
-      else
-      {
-        $this->xml="";
-      }
-
-      $this->xmpTag2Exif = new XmpTag2Exif("", 0, 0);
-
-      $this->xmlData = new XmlData($this->xml);
-      $this->tagDef = new XmpTags();
-
-      $this->loadTags();
-
-      $this->isValid = $this->xmlData->isValid();
-      $this->isLoaded = $this->xmlData->isLoaded();
-
-    }
-
-    function __destruct()
-    {
-      unset($this->tags);
-      unset($this->tagDef);
-      unset($this->xmpTag2Exif);
-    }
-
-    public function getTags()
-    {
-      return($this->tags);
-    }
-
-    public function toString()
-    {
-      $returned=$this->xml;
-      return($returned);
-    }
-
-    private function loadTags()
-    {
-      if($this->xmlData->hasNodes())
-      {
-        $this->processNode($this->xmlData->getFirstNode());
-      }
-    }
-
-    private function processNode($node)
-    {
-      if(!is_null($node))
-      {
-        $node->setName($this->processNodeName($node->getName()));
-
-        foreach($node->getAttributes() as $key => $val)
-        {
-          $val['name']=$this->processNodeName($val['name']);
-          $this->addTag($val['name'], $val['value']);
-        }
-
-        if(!is_null($node->getValue()))
-        {
-          $this->addTag($node->getName(), $node->getValue());
-        }
-
-        if($node->hasChilds())
-        {
-          $this->processChildNode($node);
-        }
-
-        $this->processNode($node->getNextNode());
-      }
-    }
-
-    private function processNodeName($nodeName)
-    {
-      /*
-       * 'xap' schema have to be interpreted as a 'xmp' schema
-       * rename all 'xap' nodes in 'xmp' nodes
-       */
-      $name=preg_replace(Array("/^(xap:)/", "/^(xapMM:)/"), Array("xmp:", "xmpMM:"), $nodeName);
-
-      return($name);
-    }
-
-    private function processChildNode($node)
-    {
-      switch($node->getName())
-      {
-        /*
-         * child must be 'rdf:Seq', 'rdf:Bag' or 'rdf:Alt'
-         */
-        case "dc:contributor" : // bag
-        case "dc:creator" : // seq
-        case "dc:date" : // seq
-        case "dc:description" : // alt
-        case "dc:language" : // bag
-        case "dc:publisher" : // bag
-        case "dc:relation" : // bag
-        case "dc:rights" : // alt
-        case "dc:subject" : // bag
-        case "dc:title" : // alt
-        case "dc:Type" : // bag
-        case "xmp:Advisory" : // bag
-        case "xmp:Identifier" : // bag
-        case "xmp:Thumbnails" : // alt
-        case "xmpRights:Owner" : // bag
-        case "xmpRights:UsageTerms" : // alt
-        case "xmpMM:History" : // seq
-        case "xmpMM:Versions" : // seq
-        case "xmpBJ:JobRef" : // bag
-        case "xmpTPg:Fonts" : // bag
-        case "xmpTPg:Colorants" : // seq
-        case "xmpTPg:PlateNames" : // seq
-        case "photoshop:SupplementalCategories" : // bag
-        case "crs:ToneCurve" : // seq
-        case "tiff:BitsPerSample" : // seq
-        case "tiff:YCbCrSubSampling" : // seq
-        case "tiff:TransferFunction" : // seq
-        case "tiff:WhitePoint" : // seq
-        case "tiff:PrimaryChromaticities" : // seq
-        case "tiff:YCbCrCoefficients" : // seq
-        case "tiff:ReferenceBlackWhite" : // seq
-        case "tiff:ImageDescription" : // alt
-        case "tiff:Copyright" : // alt
-        case "exif:ComponentsConfiguration" : // seq
-        case "exif:UserComment" : // alt
-        case "exif:ISOSpeedRatings" : // seq
-        case "exif:SubjectArea" : // seq
-        case "exif:SubjectLocation" : // seq
-        case "Iptc4xmpCore:Scene": //bag
-        case "Iptc4xmpCore:SubjectCode": //bag
-          $child=$node->getFirstChild();
-          switch($child->getName())
-          {
-            case "rdf:Seq":
-              $type="seq";
-              break;
-            case "rdf:Bag":
-              $type="bag";
-              break;
-            case "rdf:Alt":
-              $type="alt";
-              break;
-            default:
-              $type="n/a";
-              break;
-          }
-          if($type=="seq" or $type=="bag" or $type="alt")
-          {
-            $value=Array('type' => $type, 'values' => Array());
-            $childNode=$child->getFirstChild();
-            while(!is_null($childNode))
-            {
-              if($childNode->getName() == "rdf:li")
-              {
-                if($type=="alt")
-                {
-                  $attributes=$childNode->getAttributes();
-                  if(count($attributes)>0)
-                  {
-                    $attributes=$attributes[0];
-                  }
-                  else
-                  {
-                    $attributes="n/a";
-                  }
-                  $value['values'][]=Array('type' => $attributes, 'value' => $childNode->getValue());
-                }
-                else
-                {
-                  $value['values'][]=$childNode->getValue();
-                }
-              }
-              $childNode=$childNode->getNextNode();
-            }
-            $this->addTag($node->getName(), $value);
-          }
-          break;
-        default:
-          $this->processNode($node->getFirstChild());
-          break;
-      }
-    }
-
-    private function addTag($name, $value)
-    {
-      $tag=new Tag($name, $value, $name);
-
-      if($this->tagDef->tagIdExists($name))
-      {
-        $tagProperties=$this->tagDef->getTagById($name);
-
-        $tag->setIsKnown(true);
-        $tag->setIsImplemented($tagProperties['implemented']);
-
-
-        if(array_key_exists('name', $tagProperties))
-        {
-          $tag->setName($tagProperties['name']);
-        }
-
-        /*
-         * if there is values defined for the tag, analyze it
-         */
-        if(array_key_exists('tagValues', $tagProperties))
-        {
-          if(array_key_exists($value, $tagProperties['tagValues']))
-          {
-            $tag->setLabel($tagProperties['tagValues'][$value]);
-          }
-          else
-          {
-            $tag->setLabel("[unknow value '".$value."']");
-          }
-        }
-        else
-        {
-          /*
-           * there is no values defined for the tag, analyzing it with dedicated
-           * function
-           */
-          if(array_key_exists('exifTag', $tagProperties))
-          {
-            $tag->setLabel($this->xmp2Exif($name, $tagProperties['exifTag'], $value));
-          }
-          else
-          {
-            $tag->setLabel($this->processSpecialTag($name, $value));
-          }
-
-        }
-      }
-
-      $this->tags[]=$tag;
-    }
-
-    private function processSpecialTag($name, $value)
-    {
-      /*
-       * Note : exif & tiff values are not processed in this function
-       */
-      switch($name)
-      {
-        case "x:xmptk":
-        case "dc:coverage":
-        case "dc:format":
-        case "dc:identifier":
-        case "dc:relation":
-        case "dc:source":
-        case "dc:title":
-        case "xmp:BaseURL":
-        case "xmp:CreatorTool":
-        case "xmp:Label":
-        case "xmp:Nickname":
-        case "xmp:Rating:":
-        case "xmpRights:Certificate":
-        case "xmpRights:Marked":
-        case "xmpRights:UsageTerms":
-        case "xmpRights:WebStatement":
-        case "xmpMM:DocumentID":
-        case "xmpMM:InstanceID":
-        case "xmpMM:Manager":
-        case "xmpMM:ManageTo":
-        case "xmpMM:ManageUI":
-        case "xmpMM:ManagerVariant":
-        case "xmpMM:RenditionParams":
-        case "xmpMM:VersionID":
-        case "xmpMM:LastURL":
-        case "photoshop:AuthorsPosition":
-        case "photoshop:CaptionWriter":
-        case "photoshop:Category":
-        case "photoshop:City":
-        case "photoshop:Country":
-        case "photoshop:Credit":
-        case "photoshop:Headline":
-        case "photoshop:Instructions":
-        case "photoshop:Source":
-        case "photoshop:State":
-        case "photoshop:TransmissionReference":
-        case "crs:AutoBrightness":
-        case "crs:AutoContrast":
-        case "crs:AutoExposure":
-        case "crs:AutoShadows":
-        case "crs:BlueHue":
-        case "crs:BlueSaturation":
-        case "crs:Brightness":
-        case "crs:CameraProfile":
-        case "crs:ChromaticAberrationB":
-        case "crs:ChromaticAberrationR":
-        case "crs:ColorNoiseReduction":
-        case "crs:Contrast":
-        case "crs:CropTop":
-        case "crs:CropLeft":
-        case "crs:CropBottom":
-        case "crs:CropRight":
-        case "crs:CropAngle":
-        case "crs:CropWidth":
-        case "crs:CropHeight":
-        case "crs:Exposure":
-        case "crs:GreenHue":
-        case "crs:GreenSaturation":
-        case "crs:HasCrop":
-        case "crs:HasSettings":
-        case "crs:LuminanceSmoothing":
-        case "crs:RawFileName":
-        case "crs:RedHue":
-        case "crs:RedSaturation":
-        case "crs:Saturation":
-        case "crs:Shadows":
-        case "crs:ShadowTint":
-        case "crs:Sharpness":
-        case "crs:Temperature":
-        case "crs:Tint":
-        case "crs:Version":
-        case "crs:VignetteAmount":
-        case "crs:VignetteMidpoint":
-        case "Iptc4xmpCore:CountryCode":
-        case "Iptc4xmpCore:Location":
-        case "Iptc4xmpCore:CiEmailWork":
-        case "Iptc4xmpCore:CiUrlWork":
-        case "Iptc4xmpCore:CiTelWork":
-        case "Iptc4xmpCore:CiAdrExtadr":
-        case "Iptc4xmpCore:CiAdrPcode":
-        case "Iptc4xmpCore:CiAdrCity":
-        case "Iptc4xmpCore:CiAdrCtry":
-          $returned=$value;
-          break;
-        case "Iptc4xmpCore:IntellectualGenre":
-          $returned=explode(":", $value);
-          break;
-        case "xmp:CreateDate":
-        case "xmp:ModifyDate":
-        case "xmp:MetadataDate":
-        case "tiff:DateTime":
-        case "photoshop:DateCreated":
-        case "Iptc4xmpCore:DateCreated":
-          $returned=ConvertData::toDateTime($value);
-          break;
-        case "dc:contributor" : // bag
-        case "dc:creator" : // seq
-        case "dc:date" : // seq
-        case "dc:description" : // alt
-        case "dc:language" : // bag
-        case "dc:publisher" : // bag
-        case "dc:relation" : // bag
-        case "dc:rights" : // alt
-        case "dc:subject" : // bag
-        case "dc:title" : // alt
-        case "dc:Type" : // bag
-        case "xmp:Advisory" : // bag
-        case "xmp:Identifier" : // bag
-        case "xmp:Thumbnails" : // alt
-        case "xmpRights:Owner" : // bag
-        case "xmpRights:UsageTerms" : // alt
-        case "xmpMM:History" : // seq
-        case "xmpMM:Versions" : // seq
-        case "xmpBJ:JobRef" : // bag
-        case "xmpTPg:Fonts" : // bag
-        case "xmpTPg:Colorants" : // seq
-        case "xmpTPg:PlateNames" : // seq
-        case "photoshop:SupplementalCategories" : // bag
-        case "crs:ToneCurve" : // seq
-        case "tiff:BitsPerSample" : // seq
-        case "tiff:YCbCrSubSampling" : // seq
-        case "tiff:TransferFunction" : // seq
-        case "tiff:WhitePoint" : // seq
-        case "tiff:PrimaryChromaticities" : // seq
-        case "tiff:YCbCrCoefficients" : // seq
-        case "tiff:ReferenceBlackWhite" : // seq
-        case "tiff:ImageDescription" : // alt
-        case "tiff:Copyright" : // alt
-        case "exif:ComponentsConfiguration" : // seq
-        case "exif:UserComment" : // alt
-        case "exif:ISOSpeedRatings" : // seq
-        case "exif:SubjectArea" : // seq
-        case "exif:SubjectLocation" : // seq
-          $returned=$value;
-          break;
-        case "Iptc4xmpCore:Scene": //bag
-          $tag=$this->tagDef->getTagById('Iptc4xmpCore:Scene');
-          $returned=$value;
-          foreach($returned['values'] as $key=>$val)
-          {
-            if(array_key_exists($val, $tag['tagValues.special']))
-              $returned['values'][$key]=$tag['tagValues.special'][$val];
-          }
-          break;
-        case "Iptc4xmpCore:SubjectCode": //bag
-          $returned=$value;
-          foreach($returned['values'] as $key=>$val)
-          {
-            $tmp=explode(":", $val);
-
-            $returned['values'][$key]=Array();
-
-            if(count($tmp)>=1)
-              $returned['values'][$key]['IPR']=$tmp[0];
-
-            if(count($tmp)>=2)
-              $returned['values'][$key]['subjectCode']=$tmp[1];
-
-            if(count($tmp)>=3)
-              $returned['values'][$key]['subjectName']=$tmp[2];
-
-            if(count($tmp)>=4)
-              $returned['values'][$key]['subjectMatterName']=$tmp[3];
-
-            if(count($tmp)>=5)
-              $returned['values'][$key]['subjectDetailName']=$tmp[4];
-          }
-          break;
-        default:
-          $returned="Not yet implemented; $name";
-          break;
-      }
-      return($returned);
-    }
-
-    private function xmp2Exif($tagName, $exifTag, $xmpValue)
-    {
-      switch($tagName)
-      {
-        /* integers */
-        case "tiff:ImageWidth":
-        case "tiff:ImageLength":
-        case "tiff:PhotometricInterpretation":
-        case "tiff:Orientation":
-        case "tiff:SamplesPerPixel":
-        case "tiff:PlanarConfiguration":
-        case "tiff:YCbCrSubSampling":
-        case "tiff:YCbCrPositioning":
-        case "tiff:ResolutionUnit":
-        case "exif:ColorSpace":
-        case "exif:PixelXDimension":
-        case "exif:PixelYDimension":
-        case "exif:MeteringMode":
-        case "exif:LightSource":
-        case "exif:FlashEnergy":
-        case "exif:FocalPlaneResolutionUnit":
-        case "exif:SensingMethod":
-        case "exif:FileSource":
-        case "exif:SceneType":
-        case "exif:CustomRendered":
-        case "exif:ExposureMode":
-        case "exif:WhiteBalance":
-        case "exif:FocalLengthIn35mmFilm":
-        case "exif:SceneCaptureType":
-        case "exif:GainControl":
-        case "exif:Contrast":
-        case "exif:Saturation":
-        case "exif:Sharpness":
-        case "exif:SubjectDistanceRange":
-        case "exif:GPSAltitudeRef":
-        case "exif:GPSDifferential":
-          $returned=(int)$xmpValue;
-          $type=ByteType::ULONG;
-          break;
-        /* specials */
-        case "tiff:BitsPerSample":
-        case "tiff:Compression":
-        case "tiff:TransferFunction":
-        case "tiff:WhitePoint":
-        case "tiff:PrimaryChromaticities":
-        case "tiff:YCbCrCoefficients":
-        case "tiff:ReferenceBlackWhite":
-        case "exif:ComponentsConfiguration":
-        case "exif:ExposureProgram":
-        case "exif:ISOSpeedRatings":
-        case "exif:OECF":
-        case "exif:Flash":
-        case "exif:SubjectArea":
-        case "exif:SpatialFrequencyResponse":
-        case "exif:SubjectLocation":
-        case "exif:CFAPattern":
-        case "exif:DeviceSettingDescription":
-        case "exif:GPSLatitude":
-        case "exif:GPSLongitude":
-        case "exif:GPSDestLatitude":
-        case "exif:GPSDestLongitude":
-          $returned=$xmpValue;
-          $type=ByteType::UNDEFINED;
-          break;
-        /* rational */
-        case "tiff:XResolution":
-        case "tiff:YResolution":
-        case "exif:CompressedBitsPerPixel":
-        case "exif:ExposureTime":
-        case "exif:FNumber":
-        case "exif:ShutterSpeedValue":
-        case "exif:ApertureValue":
-        case "exif:BrightnessValue":
-        case "exif:ExposureBiasValue":
-        case "exif:MaxApertureValue":
-        case "exif:SubjectDistance":
-        case "exif:FocalLength":
-        case "exif:FocalPlaneXResolution":
-        case "exif:FocalPlaneYResolution":
-        case "exif:ExposureIndex":
-        case "exif:DigitalZoomRatio":
-        case "exif:GPSAltitude":
-        case "exif:GPSDOP":
-        case "exif:GPSSpeed":
-        case "exif:GPSTrack":
-        case "exif:GPSImgDirection":
-        case "exif:GPSDestBearing":
-        case "exif:GPSDestDistance":
-          $computed=explode("/", $xmpValue);
-          $returned=Array((int)$computed[0], (int)$computed[1]);
-          $type=ByteType::URATIONAL;
-          break;
-        /* dates & texts */
-        case "tiff:DateTime":
-        case "tiff:ImageDescription":
-        case "tiff:Make":
-        case "tiff:Model":
-        case "tiff:Software":
-        case "tiff:Artist":
-        case "tiff:Copyright":
-        case "exif:ExifVersion":
-        case "exif:FlashpixVersion":
-        case "exif:UserComment":
-        case "exif:RelatedSoundFile":
-        case "exif:DateTimeOriginal":
-        case "exif:DateTimeDigitized":
-        case "exif:SpectralSensitivity":
-        case "exif:ImageUniqueID":
-        case "exif:GPSVersionID":
-        case "exif:GPSTimeStamp":
-        case "exif:GPSSatellites":
-        case "exif:GPSStatus":
-        case "exif:GPSMeasureMode":
-        case "exif:GPSSpeedRef":
-        case "exif:GPSTrackRef":
-        case "exif:GPSImgDirectionRef":
-        case "exif:GPSMapDatum":
-        case "exif:GPSDestBearingRef":
-        case "exif:GPSDestDistanceRef":
-        case "exif:GPSProcessingMethod":
-        case "exif:GPSAreaInformation":
-          $returned=$xmpValue;
-          $type=ByteType::ASCII;
-          break;
-        default:
-          $returned="Unknown tag: $tagName => $xmpValue";
-          break;
-      }
-      if(is_array($returned))
-      {
-        if(array_key_exists('type', $returned))
-        {
-          if($returned['type']=='alt')
-          {
-          }
-          else
-          {
-            foreach($returned['values'] as $key => $val)
-            {
-              $returned['values'][$key]['value']=$this->xmpTag2Exif->convert($exifTag, $val['value'], $type);
-            }
-          }
-        }
-        else
-        {
-          return($this->xmpTag2Exif->convert($exifTag, $returned, $type));
-        }
-      }
-      return($returned);
-    }
-
-  }
-
-
-  class XmpTag2Exif extends IfdReader
-  {
-    public function convert($exifTag, $value, $type)
-    {
-      return($this->processSpecialTag($exifTag, $value, $type));
-    }
-  }
-
-?>
-
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/GpsTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/GpsTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/GpsTags.class.php	(revision 4698)
@@ -10,7 +10,37 @@
  *
  *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
- * Known IFD tags properties class
+ *
+ * The GpsTags is the definition of the Gps Exif tags
+ *
  * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ * The GpsTags class is derived from the KnownTags class.
+ *
+ * ======> See KnownTags.class.php to know more about the tag definitions <=====
+ *
  */
 
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/IfdTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/IfdTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/IfdTags.class.php	(revision 4698)
@@ -10,7 +10,37 @@
  *
  *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
- * Known IFD tags properties class
+ *
+ * The IfdTags is the definition of the Tiff & Exif tags
+ *
  * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ * The IfdTags class is derived from the KnownTags class.
+ *
+ * ======> See KnownTags.class.php to know more about the tag definitions <=====
+ *
  */
 
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/IptcTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/IptcTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/IptcTags.class.php	(revision 4698)
@@ -10,7 +10,37 @@
  *
  *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
- * Known IPTC tags properties class
+ *
+ * The IptcTags is the definition of the IPTC tags
+ *
  * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ * The IptcTags class is derived from the KnownTags class.
+ *
+ * ======> See KnownTags.class.php to know more about the tag definitions <=====
+ *
  */
 
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/KnownTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/KnownTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/KnownTags.class.php	(revision 4698)
@@ -9,9 +9,80 @@
  *   << May the Little SpaceFrog be with you ! >>
  *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
  *
+ * The KnownTags is a generic class to manage the definition of tags
+ *
+ * Tags are defined in an array $tags :
+ *  - key   => the Tag ID (UShort for exif & Iptc, String for Xmp)
+ *  - value => an array with theses properties
+ *
+ *      Common properties
+ *       'tagName'      => String : the official name of the tag (used for
+ *                         translation)
+ *       'tagValues'    => Array : an array to associate a label for each known
+ *                         values
+ *       'translatable' => Boolean : set to true if the value can be translated
+ *       'implemented'  => Boolean : set to true if the tag needs a specific
+ *                         interpretation and is implemented
+ *       'schema'       => String : schema associated with the tag
+ *                         exif : "tiff", "exif", "gps", "pentax", ...
+ *                         xmp : "dc", "exif", "photoshop", ...
+ *                         => not yet defined for Iptc....
+ *       'tagValues.special' => used on some tags for implementation
+ *
+ *      Exif like tags
+ *       'combiTag'     => Integer : use on some specific tags
+ *
+ *      Xmp specific properties (==> see XmpTags.class.php for more information)
+ *       'iptcTag'      => if the Xmp tag exist in Iptc, the Iptc tag Id
+ *       'exifTag'      => if the Xmp tag exist in Exif, the Exif tag Id
+ *       'type'         => the type of Xmp data
+ *
  * -----------------------------------------------------------------------------
  *
+ * .. Notes ..
+ *
+ * This class is not declared as an abstract class, but it's not recommanded to
+ * create object with it.
+ *
+ * Derived classes :
+ *  - GpsTags      (exif gps tags)
+ *  - IfdTag       (exif & tiff tags)
+ *  - IptcTag      (iptc tags)
+ *  - PentaxTag    (pentax exif tags)
+ *  - XmpTag       (xmp tags)
+ *
+ *
+ * This class provides theses public functions :
+ *  - getTags
+ *  - tagIdExists
+ *  - getTagById
+ *  - getTagIdByName
+ *  - getTagByName
+ *  - getLabel
+ *
  * -----------------------------------------------------------------------------
+ *
  */
 
@@ -35,4 +106,18 @@
     }
 
+    /**
+     * this function return the $tags array
+     *
+     * an optional parameter $filter can be given.
+     * its an array with the keys :
+     *  'implemented' => Integer = KNOWN_TAGS_ALL, KNOWN_TAGS_IMPLEMENTED, KNOWN_TAGS_NOT_IMPLEMENTED
+     *                   filter tags with the property 'implemented' and 'known'
+     *  'schema'      => String = name of the schema
+     *                   filter tags with the schema property
+     *
+     * @param Array $filter (optional)
+     * @return Array : an array of tags properties (see this file header to know
+     *                 more about the tag properties)
+     */
     public function getTags($filter = Array('implemented' => KNOWN_TAGS_ALL, 'schema' => NULL))
     {
@@ -64,4 +149,9 @@
     }
 
+    /**
+     * this function returns true if the given ID exists
+     *
+     * @return Boolean
+     */
     public function tagIdExists($id)
     {
@@ -69,5 +159,10 @@
     }
 
-
+    /**
+     * returns a tag, searched by its ID
+     * return false if the tag is not found
+     *
+     * @return Array : see this file header to know more about the tag properties
+     */
     public function getTagById($id)
     {
@@ -79,4 +174,10 @@
     }
 
+    /**
+     * returns the tag ID, searched by its name property
+     * return false if the tag is not found
+     *
+     * @return String or UShort
+     */
     public function getTagIdByName($name)
     {
@@ -89,12 +190,24 @@
     }
 
+    /**
+     * returns a Tag, searched by its name property
+     * return false if the tag is not found
+     *
+     * @return Array : see this file header to know more about the tag properties
+     */
     public function getTagByName($name)
     {
       $index=$this->getTagIdByName($name);
-      if(index!==false)
+      if($index!==false)
         return($this->tags[$index]);
       return(false);
     }
 
+    /**
+     * return the label associated with the tag defininition
+     * (something like "Exif & Tiff tags" or "Pentax specific tags")
+     *
+     * @return String
+     */
     public function getLabel()
     {
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php	(revision 4698)
@@ -9,15 +9,44 @@
  *   << May the Little SpaceFrog be with you ! >>
  *
- * -----------------------------------------------------------------------------
  *
- * Pentax values from
- * - ExifTool / Copyright - Phil Harvey <phil at owl.phy.queensu.ca>
- * - Exiv2    / Copyright - Andreas Huggel <ahuggel at gmx.net>
- *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
  *
  *
  * -----------------------------------------------------------------------------
- * Pentax tags definition & Pentax reader class
+ *
+ * The PentaxTags is the definition of the specific Pentax Exif tags
+ *
  * -----------------------------------------------------------------------------
+ *
+ * .. Notes ..
+ *
+ * The PentaxTags class is derived from the KnownTags class.
+ *
+ * ======> See KnownTags.class.php to know more about the tag definitions <=====
+ *
+ *
+ * Pentax values from
+ *  - Exiftool by Phil Harvey    => http://www.sno.phy.queensu.ca/~phil/exiftool/
+ *                                  http://owl.phy.queensu.ca/~phil/exiftool/TagNames
+ *  - Exiv2 by Andreas Huggel    => http://www.exiv2.org/
+ *
  */
 
@@ -38,5 +67,5 @@
       0x0001 => Array(
         'tagName'     => "ShootingMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -52,5 +81,5 @@
       0x0005 => Array(
         'tagName'     => "CameraModel",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -148,5 +177,5 @@
       0x0008 => Array(
         'tagName'     => "Quality",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -166,5 +195,5 @@
       0x0009 => Array(
         'tagName'     => "Size",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -196,5 +225,5 @@
       0x000b => Array(
         'tagName'     => "PictureMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -244,5 +273,5 @@
       0x000c => Array(
         'tagName'     => "Flash",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -283,5 +312,5 @@
       0x000d => Array(
         'tagName'     => "Focus",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -303,5 +332,5 @@
       0x000e => Array(
         'tagName'     => "AFPoint",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -329,5 +358,5 @@
       0x000f => Array(
         'tagName'     => "AFPointsInFocus",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -351,5 +380,5 @@
       0x0014 => Array(
         'tagName'     => "ISO",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -405,5 +434,5 @@
       0x0017 => Array(
         'tagName'     => "MeteringMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -419,5 +448,5 @@
       0x0019 => Array(
         'tagName'     => "WhiteBallance",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -444,5 +473,5 @@
       0x001a => Array(
         'tagName'     => "WhiteBallanceMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -465,5 +494,5 @@
       0x001f => Array(
         'tagName'     => "Saturation",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -484,5 +513,5 @@
       0x0020 => Array(
         'tagName'     => "Contrast",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -502,5 +531,5 @@
       0x0021 => Array(
         'tagName'     => "Sharpness",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -520,5 +549,5 @@
       0x0022 => Array(
         'tagName'     => "WorldTimeLocation",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -533,5 +562,5 @@
       0x0023 => Array(
         'tagName'     => "HomeCityName",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -616,5 +645,5 @@
       0x0024 => Array(
         'tagName'     => "DestinationCityName",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -700,5 +729,5 @@
       0x0032 => Array(
         'tagName'     => "ImageProcessing",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 4,
@@ -717,5 +746,5 @@
       0x0033 => Array(
         'tagName'     => "PictureMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 3,
@@ -793,5 +822,5 @@
       0x0034 => Array(
         'tagName'     => "DriveMode",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 4,
@@ -817,5 +846,5 @@
       0x0037 => Array(
         'tagName'     => "ColorSpace",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -830,5 +859,5 @@
       0x003f => Array(
         'tagName'     => "LensType",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 2,
@@ -993,5 +1022,5 @@
       0x004f => Array(
         'tagName'     => "ImageTone",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -1011,5 +1040,5 @@
       0x0069 => Array(
         'tagName'     => "DynamicRangeExpansion",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 4,
@@ -1025,5 +1054,5 @@
       0x0071 => Array(
         'tagName'     => "HighISONoiseReduction",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -1045,5 +1074,5 @@
       0x0000 => Array(
         'tagName'     => "Version",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1054,5 +1083,5 @@
       0x0002 => Array(
         'tagName'     => "PreviewResolution",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1063,5 +1092,5 @@
       0x0003 => Array(
         'tagName'     => "PreviewLength",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1072,5 +1101,5 @@
       0x0004 => Array(
         'tagName'     => "PreviewOffset",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1081,5 +1110,5 @@
       0x0006 => Array(
         'tagName'     => "Date",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1090,5 +1119,5 @@
       0x0007 => Array(
         'tagName'     => "Time",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1099,5 +1128,5 @@
       0x0010 => Array(
         'tagName'     => "FocusPosition",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1108,5 +1137,5 @@
       0x0012 => Array(
         'tagName'     => "ExposureTime",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1117,5 +1146,5 @@
       0x0013 => Array(
         'tagName'     => "FNumber",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1126,5 +1155,5 @@
       0x0015 => Array(
         'tagName'     => "LightReading",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1136,5 +1165,5 @@
       0x0016 => Array(
         'tagName'     => "ExposureCompensation",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1145,5 +1174,5 @@
       0x0018 => Array(
         'tagName'     => "AutoBracketing",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -1154,5 +1183,5 @@
       0x001b => Array(
         'tagName'     => "BlueBalance",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1163,5 +1192,5 @@
       0x001c => Array(
         'tagName'     => "RedBalance",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1172,5 +1201,5 @@
       0x001d => Array(
         'tagName'     => "FocalLength",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1181,5 +1210,5 @@
       0x001e => Array(
         'tagName'     => "DigitalZoom",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1191,5 +1220,5 @@
       0x0025 => Array(
         'tagName'     => "HometownDST",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1200,5 +1229,5 @@
       0x0026 => Array(
         'tagName'     => "DestinationDST",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1209,5 +1238,5 @@
       0x0027 => Array(
         'tagName'     => "DSPFirmwareVersion",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1218,5 +1247,5 @@
       0x0028 => Array(
         'tagName'     => "CPUFirmwareVersion",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1227,5 +1256,5 @@
       0x0029 => Array(
         'tagName'     => "FrameNumber",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1236,5 +1265,5 @@
       0x002d => Array(
         'tagName'     => "EffectiveLV",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1245,5 +1274,5 @@
       0x0038 => Array(
         'tagName'     => "ImageAreaOffset",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1254,5 +1283,5 @@
       0x0039 => Array(
         'tagName'     => "RawImageSize",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1263,5 +1292,5 @@
       0x003c => Array(
         'tagName'     => "AFPointsInFocus",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1272,5 +1301,5 @@
       0x003e => Array(
         'tagName'     => "PreviewImageBorders",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1281,5 +1310,5 @@
       0x0040 => Array(
         'tagName'     => "SensitivityAdjust",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1290,5 +1319,5 @@
       0x0041 => Array(
         'tagName'     => "DigitalFilter",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1299,5 +1328,5 @@
       0x0047 => Array(
         'tagName'     => "Temperature",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1308,5 +1337,5 @@
       0x0048 => Array(
         'tagName'     => "AELock",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -1317,5 +1346,5 @@
       0x0049 => Array(
         'tagName'     => "NoiseReduction",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> true,
         'combiTag'    => 0,
@@ -1326,5 +1355,5 @@
       0x004d => Array(
         'tagName'     => "FlashExposureCompensation",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1335,5 +1364,5 @@
       0x0050 => Array(
         'tagName'     => "ColorTemperature",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1344,5 +1373,5 @@
       0x005c => Array(
         'tagName'     => "ShakeReduction",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1353,5 +1382,5 @@
       0x005d => Array(
         'tagName'     => "ShutterCount",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1362,5 +1391,5 @@
       0x0072 => Array(
         'tagName'     => "AFAdjustment",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1372,5 +1401,5 @@
       0x0200 => Array(
         'tagName'     => "BlackPoint",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1381,5 +1410,5 @@
       0x0201 => Array(
         'tagName'     => "WhitePoint",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1390,5 +1419,5 @@
       0x0203 => Array(
         'tagName'     => "ColorMatrixA",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1399,5 +1428,5 @@
       0x0204 => Array(
         'tagName'     => "ColorMatrixB",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1408,5 +1437,5 @@
       0x0205 => Array(
         'tagName'     => "ShotInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1417,5 +1446,5 @@
       0x0206 => Array(
         'tagName'     => "AEInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1426,5 +1455,5 @@
       0x0207 => Array(
         'tagName'     => "LensInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1435,5 +1464,5 @@
       0x0208 => Array(
         'tagName'     => "FlashInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1444,5 +1473,5 @@
       0x0209 => Array(
         'tagName'     => "AEMeteringSegments",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1453,5 +1482,5 @@
       0x020a => Array(
         'tagName'     => "FlashADump",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1462,5 +1491,5 @@
       0x020b => Array(
         'tagName'     => "FlashBDump",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1471,5 +1500,5 @@
       0x020d => Array(
         'tagName'     => "WB_RGGBLevelsDaylight",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1480,5 +1509,5 @@
       0x020e => Array(
         'tagName'     => "WB_RGGBLevelsShade",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1489,5 +1518,5 @@
       0x020f => Array(
         'tagName'     => "WB_RGGBLevelsCloudy",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1498,5 +1527,5 @@
       0x0210 => Array(
         'tagName'     => "WB_RGGBLevelsTungsten",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1507,5 +1536,5 @@
       0x0211 => Array(
         'tagName'     => "WB_RGGBLevelsFluorescentD",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1516,5 +1545,5 @@
       0x0212 => Array(
         'tagName'     => "WB_RGGBLevelsFluorescentN",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1525,5 +1554,5 @@
       0x0213 => Array(
         'tagName'     => "WB_RGGBLevelsFluorescentW",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1534,5 +1563,5 @@
       0x0214 => Array(
         'tagName'     => "WB_RGGBLevelsFlash",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1543,5 +1572,5 @@
       0x0215 => Array(
         'tagName'     => "CameraInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1552,5 +1581,5 @@
       0x0216 => Array(
         'tagName'     => "BatteryInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1561,5 +1590,5 @@
       0x021b => Array(
         'tagName'     => "SaturationInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1570,5 +1599,5 @@
       0x021f => Array(
         'tagName'     => "AFInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1579,5 +1608,5 @@
       0x0220 => Array(
         'tagName'     => "HuffmanTable",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1588,5 +1617,5 @@
       0x0222 => Array(
         'tagName'     => "ColorInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1597,5 +1626,5 @@
       0x0224 => Array(
         'tagName'     => "EVStepInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1606,5 +1635,5 @@
       0x0229 => Array(
         'tagName'     => "SerialNumber",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1615,5 +1644,5 @@
       0x0230 => Array(
         'tagName'     => "FirmwareVersion",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1624,5 +1653,5 @@
       0x03fe => Array(
         'tagName'     => "DataDump",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1633,5 +1662,5 @@
       0x03ff => Array(
         'tagName'     => "UnknownInfo",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1642,5 +1671,5 @@
       0x0402 => Array(
         'tagName'     => "ToneCurve",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1651,5 +1680,5 @@
       0x0403 => Array(
         'tagName'     => "ToneCurves",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
@@ -1660,5 +1689,5 @@
       0x0e00 => Array(
         'tagName'     => "PrintIM",
-        'group' => Array("Pentax"),
+        'schema'      => "Pentax",
         'translatable'=> false,
         'combiTag'    => 0,
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/XmpTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/XmpTags.class.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/XmpTags.class.php	(revision 4698)
@@ -10,6 +10,29 @@
  *
  *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
  * -----------------------------------------------------------------------------
- * Known Xmp tags properties class
+ *
+ * The XmpTags is the definition of the XMP tags
+ *
  * -----------------------------------------------------------------------------
  */
@@ -1790,10 +1813,11 @@
         'schema'       => "Iptc4xmpCore",
       ),
-
-
     );
 
-
-
+    /**
+     * XmpTags needs a specific constructor, allowing to extract exif & iptc
+     * properties for some tags
+     *
+     */
     function __construct()
     {
Index: /extensions/AMetaData/JpegMetaData/test/index.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/test/index.php	(revision 4697)
+++ /extensions/AMetaData/JpegMetaData/test/index.php	(revision 4698)
@@ -1,3 +1,44 @@
 <?php
+/*
+ * --:: JPEG MetaDatas ::-------------------------------------------------------
+ *
+ *  Author    : Grum
+ *   email    : grum at piwigo.org
+ *   website  : http://photos.grum.fr
+ *
+ *   << May the Little SpaceFrog be with you ! >>
+ *
+ *
+ * +-----------------------------------------------------------------------+
+ * | JpegMetaData - a PHP based Jpeg Metadata manager                      |
+ * +-----------------------------------------------------------------------+
+ * | Copyright(C) 2010  Grum - http://www.grum.fr                          |
+ * +-----------------------------------------------------------------------+
+ * | This program is free software; you can redistribute it and/or modify  |
+ * | it under the terms of the GNU General Public License as published by  |
+ * | the Free Software Foundation                                          |
+ * |                                                                       |
+ * | This program is distributed in the hope that it will be useful, but   |
+ * | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+ * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+ * | General Public License for more details.                              |
+ * |                                                                       |
+ * | You should have received a copy of the GNU General Public License     |
+ * | along with this program; if not, write to the Free Software           |
+ * | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+ * | USA.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * This file is used to test the capabilities of the JpegMetaData classes
+ *
+ * -----------------------------------------------------------------------------
+ *
+ *
+ * -----------------------------------------------------------------------------
+ */
+
  ini_set('error_reporting', E_ALL | E_STRICT);
  ini_set('display_errors', true);
@@ -13,350 +54,327 @@
   require_once(JPEG_METADATA_DIR."TagDefinitions/XmpTags.class.php");
 
-echo "
-<html>
-<header>
-<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
-</header>
-<body>
--- Tests --<br>
-";
-
-echo "<hr>-- Images --<br>";
-
-$d = scandir(dirname(__FILE__));
-
-foreach($d as $key => $file)
-{
-  if(preg_match("/.*\.(jpg|jpeg)/i",$file))
-    echo "[<a href='?file=".$file."'>$file</a>]&nbsp; ";
-}
-
-
-echo "<hr>-- Resultat --<br>";
-
-
-function dump_xml($xml)
-{
-  $color=Array(
-   0 => "000000",
-   1 => "ff0000",
-   2 => "0000ff",
-   3 => "008000",
-   4 => "800000",
-   5 => "000080",
-   6 => "008080",
-   7 => "808000",
-   8 => "800080",
-   9 => "808080");
-
-  $parser = xml_parser_create();
-  xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
-  xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
-  xml_parse_into_struct($parser, $xml, $values, $tags);
-  xml_parser_free($parser);
-
-  foreach($values as $key => $val)
-  {
-    switch($val['type'])
-    {
-      case "open":
-        echo "<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."".$val['tag']."</span>";
-        if(array_key_exists("attributes", $val))
-          foreach($val['attributes'] as $key2 => $val2)
+
+  /*
+   * functions
+   *
+   */
+
+  function dump_xml($xml)
+  {
+    $returned="";
+
+    $color=Array(
+     0 => "000000",
+     1 => "ff0000",
+     2 => "0000ff",
+     3 => "008000",
+     4 => "800000",
+     5 => "000080",
+     6 => "008080",
+     7 => "808000",
+     8 => "800080",
+     9 => "808080");
+
+    $parser = xml_parser_create();
+    xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
+    xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+    xml_parse_into_struct($parser, $xml, $values, $tags);
+    xml_parser_free($parser);
+
+    foreach($values as $key => $val)
+    {
+      switch($val['type'])
+      {
+        case "open":
+          $returned.="<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."".$val['tag']."</span>";
+          if(array_key_exists("attributes", $val))
+            foreach($val['attributes'] as $key2 => $val2)
+            {
+              $returned.="<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            }
+          break;
+        case "close":
+          $returned.="<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."/".$val['tag']."</span>";
+          if(array_key_exists("attributes", $val))
+            foreach($val['attributes'] as $key2 => $val2)
+            {
+              $returned.="<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            }
+          break;
+        case "complete":
+          $returned.="<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."/".$val['tag']."</span>";
+          if(array_key_exists("attributes", $val))
+            foreach($val['attributes'] as $key2 => $val2)
+            {
+              $returned.="<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            }
+          break;
+      }
+      if(array_key_exists('value', $val))
+       $returned.=" <span style='color:#ff00ff;'>".$val['value']."</span>";
+      $returned.="<br>";
+
+    }
+
+    return($returned);
+  }
+
+
+  function dump_ifd($key2, $val2)
+  {
+    $returned=sprintf("IFD %02d: ", $key2).$val2->toString()."<br>";
+
+    foreach($val2->getTags() as $key3 => $val3)
+    {
+      $returned.=dump_tag($key3, $val3->getTag(), "<span style='color:#804080;'>".sprintf("[%02d] ", $key3).$val3->toString()."</span><br>");
+
+      if($val3->getTag()->getLabel() instanceof IfdReader)
+      {
+        $returned.="<div style='padding:1px;margin-bottom:2px;margin-right:4px;margin-left:25px;border:1px dotted #6060FF;'>";
+        $returned.=dump_ifd($key3, $val3->getTag()->getLabel());
+        $returned.="</div>";
+      }
+    }
+    return($returned);
+  }
+
+
+  function dump_xmp($key2, $val2)
+  {
+    if(is_string($val2->getValue()))
+      $extra=$val2->getValue();
+    elseif(is_array($val2->getValue()))
+      $extra=print_r($val2->getValue(), true);
+    else
+      $extra=ConvertData::toHexDump($val2->getValue(), ByteType::ASCII);
+
+    $extra="<br><span style='color:#000000;'>".$extra."</span><br>";
+
+    $returned="<div style='color:#000000;margin-left:12px;border-bottom:1px solid #808080;";
+    if(!$val2->isKnown())
+    {
+      $returned.="background:#ffd0d0;'>";
+    }
+    elseif(!$val2->isImplemented())
+    {
+      $returned.="background:#ffffd0;'>";
+    }
+    else
+    {
+      $returned.="background:#d0ffd0;'>";
+      $extra="";
+    }
+
+    $returned.="<span style='color:#804080;'>".$val2->toString().$extra."</span></div>";
+
+    return($returned);
+  }
+
+
+  function dump_tag($key3, $val3, $extra)
+  {
+    $returned="<div style='color:#000000;margin-left:12px;border-bottom:1px solid #808080;";
+    if(!$val3->isKnown())
+    {
+      $returned.="background:#ffd0d0;'>".$extra;
+    }
+    elseif(!$val3->isImplemented())
+    {
+      $returned.="background:#ffffd0;'>".$extra;
+    }
+    else
+    {
+      $returned.="background:#d0ffd0;'>";
+    }
+
+    $returned.=str_replace(" ", "&nbsp;", "     ").$val3->toString("small")."<br></div>";
+
+    return($returned);
+  }
+
+  /*
+  function cmp($a, $b)
+  {
+      if ($a['value'] == $b['value']) {
+          return 0;
+      }
+      return ($a['value'] < $b['value']) ? -1 : 1;
+  }
+
+  function list_for_po()
+  {
+
+    $tmpTagName=Array();
+    $tmpValues=Array();
+
+    $tagList=Array(
+      new IfdTags(),
+      new XmpTags(),
+      new IptcTags(),
+      new GpsTags(),
+      new PentaxTags(),
+    );
+
+
+    foreach($tagList as $key => $tag)
+    {
+
+      foreach($tag->getTags() as $key => $val)
+      {
+        if(array_key_exists('tagName', $val))
+          $name=$val['tagName'];
+        else
+          $name="";
+
+        if(is_string($key))
+          $tKey=$key;
+        else
+          $tKey=sprintf("0x%04x", $key);
+
+        if($name!="")
+          $tKey.=" ($name)";
+
+        if($name!="")
+        {
+          $tmpTagName[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $name);
+        }
+        else
+        {
+          $tmpTagName[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $key);
+        }
+
+        if(array_key_exists('tagValues', $val) and $val['translatable'])
+        {
+          foreach($val['tagValues'] as $key2 => $val2)
           {
-            echo "<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
           }
-        break;
-      case "close":
-        echo "<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."/".$val['tag']."</span>";
-        if(array_key_exists("attributes", $val))
-          foreach($val['attributes'] as $key2 => $val2)
+        }
+
+        if(array_key_exists('tagValues.special', $val) and $val['translatable'])
+        {
+          foreach($val['tagValues.special'] as $key2 => $val2)
           {
-            echo "<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
           }
-        break;
-      case "complete":
-        echo "<span style='color:#".$color[$val['level']]."'>(".$val['level'].")".str_repeat("&nbsp;", 3*$val['level'])."/".$val['tag']."</span>";
-        if(array_key_exists("attributes", $val))
-          foreach($val['attributes'] as $key2 => $val2)
+        }
+
+        if(array_key_exists('tagValues.specialNames', $val) and $val['translatable'])
+        {
+          foreach($val['tagValues.specialNames'] as $key2 => $val2)
           {
-            echo "<br><span style='color:#".$color[$val['level']]."'>".str_repeat("&nbsp;", 5+3*$val['level'])."<i>[".$key2."] ".$val2."</i></span>";
+            $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
           }
-        break;
-    }
-    if(array_key_exists('value', $val))
-     echo " <span style='color:#ff00ff;'>".$val['value']."</span>";
-    echo "<br>";
-
-  }
-
-  $tmp=new XmlData($xml);
-
-  //echo "has node:".($tmp->hasNodes()?"Y":"N")."<br>";
-
-  dump_node($tmp->getFirstNode());
-
-
-}
-
-function dump_node($node)
-{
-  if($node==NULL)
-    return(false);
-  //echo "name:".$node->getName()." / level:".$node->getLevel()." / attributes: ".count($node->getAttributes())." / has child:".($node->hasChilds()?"Y":"N")."<br>";
-
-  if($node->hasChilds())
-  {
-    dump_node($node->getFirstChild());
-  }
-
-  dump_node($node->getNextNode());
-}
-
-function dump_ifd($key2, $val2)
-{
-  echo sprintf("IFD %02d: ", $key2).$val2->toString()."<br>";
-
-  foreach($val2->getTags() as $key3 => $val3)
-  {
-    dump_tag($key3, $val3->getTag(), "<span style='color:#804080;'>".sprintf("[%02d] ", $key3).$val3->toString()."</span><br>");
-
-    /*
-    if($val3->isOffset())
-    {
-      echo "<div style='color:#ff0000;margin-left:40px;'>";
-      echo ConvertData::toHexDump($val3->getValue(), $val3->getType(),15)." => ".substr($val3->getValue(),0,254)."<br>";
-      echo "</div>";
-    }
-    */
-
-    if($val3->getTag()->getLabel() instanceof IfdReader)
-    {
-      echo "<div style='padding:1px;margin-bottom:2px;margin-right:4px;margin-left:25px;border:1px dotted #6060FF;'>";
-      dump_ifd($key3, $val3->getTag()->getLabel());
-      echo "</div>";
-    }
-  }
-}
-
-function dump_xmp($key2, $val2)
-{
-  if(is_string($val2->getValue()))
-    $extra=$val2->getValue();
-  elseif(is_array($val2->getValue()))
-    $extra=print_r($val2->getValue(), true);
+        }
+
+        if(array_key_exists('tagValues.specialValues', $val) and $val['translatable'])
+        {
+          foreach($val['tagValues.specialValues'] as $key2 => $val2)
+          {
+            $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
+          }
+        }
+
+        if(array_key_exists('tagValues.computed', $val) and $val['translatable'])
+        {
+          foreach($val['tagValues.computed'] as $key2 => $val2)
+          {
+            $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
+          }
+        }
+
+
+      }
+
+    }
+
+    $tmp=array_merge($tmpTagName, $tmpValues);
+    usort($tmp, "cmp");
+
+    foreach($tmp as $key => $val)
+    {
+      echo "#. ".$val['group']."<br>";
+      echo "msgid \"".$val['value']."\"<br>";
+      echo "msgstr \"".$val['value']."\"<br><br>";
+    }
+
+  }
+  */
+
+
+  $page="<html><header><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></header><body>";
+
+
+  $page.="<hr>-- Images --<br>";
+
+  /*
+   * display a list of jpeg files in the current directory
+   */
+  $directory = scandir(dirname(__FILE__));
+
+  foreach($directory as $key => $file)
+  {
+    if(preg_match("/.*\.(jpg|jpeg)/i",$file))
+      $page.="[<a href='?file=".$file."'>$file</a>]&nbsp; ";
+  }
+
+
+  $page.="<hr>-- Resultat --<br>";
+
+
+  if(isset($_GET["file"]))
+  {
+    $file=$_GET["file"];
+  }
   else
-    $extra=ConvertData::toHexDump($val2->getValue(), ByteType::ASCII);
-
-  $extra="<br><span style='color:#000000;'>".$extra."</span><br>";
-
-  echo "<div style='color:#000000;margin-left:12px;border-bottom:1px solid #808080;";
-  if(!$val2->getIsKnown())
-  {
-    echo "background:#ffd0d0;'>";
-  }
-  elseif(!$val2->getIsImplemented())
-  {
-    echo "background:#ffffd0;'>";
-  }
-  else
-  {
-    echo "background:#d0ffd0;'>";
-    $extra="";
-  }
-
-  echo "<span style='color:#804080;'>".$val2->toString().$extra;
- /* if($val2->getName()!=$val2->getId())
-    echo " ==> Id: ".$val2->getId();*/
-  echo "</span>";
-
-  echo "</div>";
-}
-
-function dump_tag($key3, $val3, $extra)
-{
-    echo "<div style='color:#000000;margin-left:12px;border-bottom:1px solid #808080;";
-    if(!$val3->getIsKnown())
-    {
-      echo "background:#ffd0d0;'>".$extra;
-    }
-    elseif(!$val3->getIsImplemented())
-    {
-      echo "background:#ffffd0;'>".$extra;
-    }
-    else
-    {
-      echo "background:#d0ffd0;'>";
-    }
-
-    echo str_replace(" ", "&nbsp;", "     ").$val3->toString("small")."<br>";
-
-    echo "</div>";
-}
-
-/*
-function cmp($a, $b)
-{
-    if ($a['value'] == $b['value']) {
-        return 0;
-    }
-    return ($a['value'] < $b['value']) ? -1 : 1;
-}
-
-function list_for_po()
-{
-
-  $tmpTagName=Array();
-  $tmpValues=Array();
-
-  $tagList=Array(
-    new IfdTags(),
-    new XmpTags(),
-    new IptcTags(),
-    new GpsTags(),
-    new PentaxTags(),
-  );
-
-
-  foreach($tagList as $key => $tag)
-  {
-
-    foreach($tag->getTags() as $key => $val)
-    {
-      if(array_key_exists('tagName', $val))
-        $name=$val['tagName'];
-      else
-        $name="";
-
-      if(is_string($key))
-        $tKey=$key;
-      else
-        $tKey=sprintf("0x%04x", $key);
-
-      if($name!="")
-        $tKey.=" ($name)";
-
-      if($name!="")
-      {
-        $tmpTagName[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $name);
-      }
-      else
-      {
-        $tmpTagName[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $key);
-      }
-
-      if(array_key_exists('tagValues', $val) and $val['translatable'])
-      {
-        foreach($val['tagValues'] as $key2 => $val2)
-        {
-          $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
-        }
-      }
-
-      if(array_key_exists('tagValues.special', $val) and $val['translatable'])
-      {
-        foreach($val['tagValues.special'] as $key2 => $val2)
-        {
-          $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
-        }
-      }
-
-      if(array_key_exists('tagValues.specialNames', $val) and $val['translatable'])
-      {
-        foreach($val['tagValues.specialNames'] as $key2 => $val2)
-        {
-          $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
-        }
-      }
-
-      if(array_key_exists('tagValues.specialValues', $val) and $val['translatable'])
-      {
-        foreach($val['tagValues.specialValues'] as $key2 => $val2)
-        {
-          $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
-        }
-      }
-
-      if(array_key_exists('tagValues.computed', $val) and $val['translatable'])
-      {
-        foreach($val['tagValues.computed'] as $key2 => $val2)
-        {
-          $tmpValues[]=Array('group' => $tag->getLabel()." / ".$tKey, 'value' => $val2);
-        }
-      }
-
-
-    }
-
-  }
-
-  $tmp=array_merge($tmpTagName, $tmpValues);
-  usort($tmp, "cmp");
-
-  foreach($tmp as $key => $val)
-  {
-    echo "#. ".$val['group']."<br>";
-    echo "msgid \"".$val['value']."\"<br>";
-    echo "msgstr \"".$val['value']."\"<br><br>";
-  }
-
-}
-*/
-
-  if(isset($_GET["file"]))
-  {
-    $file=$_GET["file"];
-  }
-  else
-  {
-    die("no filename ?<br/></body></html>");
-  }
+  {
+    $page.="no filename ?<br/></body></html>";
+    die($page);
+  }
+
+  $page.="<span style='font-family:monospace;'>";
 
   $memory=memory_get_usage();
-  echo "memory : ".$memory."<br>";
+  $time=microtime(true);
 
   $jpeg = new JpegReader($file);
-  echo "<span style='font-family:monospace;'>JpegReader<br>";
-  echo "fileName=".$jpeg->getFileName()."<br>";
-  echo "isValid=".($jpeg->isValid()?"Y":"N")."<br>";
-  echo "isLoaded=".($jpeg->isLoaded()?"Y":"N")."<br>";
-  echo "NbMarkers=".$jpeg->countAppMarkerSegments()."<br>";
+  $time2=microtime(true);
+
+  $page2="JpegReader extraction<br>";
+  $page2.="fileName=".$jpeg->getFileName()."<br>";
+  $page2.="isValid=".($jpeg->isValid()?"Y":"N")."<br>";
+  $page2.="isLoaded=".($jpeg->isLoaded()?"Y":"N")."<br>";
+  $page2.="NbMarkers=".$jpeg->countAppMarkerSegments()."<br>";
+
   foreach($jpeg->getAppMarkerSegments() as $key => $val)
   {
-    echo "<div style='border:1px solid #000000;padding:4px;margin:1px;'>";
-    echo sprintf("[%02d] ", $key).$val->toString()."<br>";
+    $page2.="<div style='border:1px solid #000000;padding:4px;margin:1px;'>";
+    $page2.=sprintf("[%02d] ", $key).$val->toString()."<br>";
     if($val->dataLoaded())
     {
-      echo "<div style='color:#0000ff;font-weight:bold;margin-left:20px;'>";
+      $page2.="<div style='color:#0000ff;font-weight:bold;margin-left:20px;'>";
       $data=$val->getData();
       if($data instanceof TiffReader)
       {
-        echo $data->toString()."<br>";
+        $page2.=$data->toString()."<br>";
 
         foreach($data->getIFDs() as $key2 => $val2)
         {
-          echo "<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
-
-          dump_ifd($key2, $val2);
-
-          echo "</div>";
-        }
-
+          $page2.="<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
+          $page2.=dump_ifd($key2, $val2);
+          $page2.="</div>";
+        }
       }
       elseif($data instanceof XmpReader)
       {
-        echo htmlentities($data->toString())."<br>";
-        echo dump_xml($data->toString())."<br>";
+        $page2.=htmlentities($data->toString())."<br>";
+        $page2.=dump_xml($data->toString())."<br>";
 
         foreach($data->getTags() as $key2 => $val2)
         {
-          echo "<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
-
-          dump_xmp($key2, $val2);
-
-          echo "</div>";
-        }
-
-
+          $page2.="<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
+          $page2.=dump_xmp($key2, $val2);
+          $page2.="</div>";
+        }
       }
       elseif($data instanceof IptcReader)
@@ -365,30 +383,23 @@
         foreach($data->getTags() as $key2 => $val2)
         {
-          echo "<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
-
-          dump_tag($key2, $val2, "");
-
-          echo "</div>";
-        }
-
-
+          $page2.="<div style='color:#0000ff;font-weight:normal;margin-left:12px;'>";
+          $page2.=dump_tag($key2, $val2, "");
+          $page2.="</div>";
+        }
       }
       else
       {
-       echo htmlentities($val->getData())."<br>";
-      }
-      echo "</div>";
-    }
-    echo "</div>";
-
-  }
-  echo "</span><hr>";
-
-
-  Locale::set("en_UK");
-
-  echo "<span style='font-family:monospace;'>JpegMetaData - tag from test file<br>";
-  echo "<table style='border:1px solid #000000;'>";
-  echo "<tr style='border-bottom:1x solid #000000;'><th>Key</th><th>Name</th><th>Value</th><th>Computed Value</th></tr>";
+       $page2.=htmlentities($val->getData())."<br>";
+      }
+      $page2.="</div>";
+    }
+    $page2.="</div>";
+  }
+  $page2.="</span><hr>";
+
+  $page2.="<div style='font-family:monospace;'>JpegMetaData - tag from test file<br>";
+  $page2.="<table style='border:1px solid #000000;width:100%;'>";
+  $page2.="<tr style='border-bottom:1x solid #000000;'><th>Key</th><th>Name</th><th>Value</th><th>Computed Value</th></tr>";
+
   $jpegmd = new JpegMetaData($file, Array(
     'filter' => JpegMetaData::TAGFILTER_IMPLEMENTED,
@@ -402,10 +413,10 @@
     $value=$val->getValue();
 
-    if($val->getIsTranslatable())
+    if($val->isTranslatable())
       $style="color:#0000ff";
     else
       $style="color:#000000";
 
-    if(is_string($txt) and $val->getIsTranslatable())
+    if(is_string($txt) and $val->isTranslatable())
       $txt=Locale::get($txt);
     if($txt instanceof DateTime)
@@ -415,25 +426,32 @@
     if(is_array($value))
       $value=print_r($value, true);
-    echo "<tr><td>".$key."</td><td>".Locale::get($val->getName())."</td><td>".$value."</td><td style='$style'>".$txt."</td></tr>";
+    $page2.="<tr><td>".$key."</td><td>".Locale::get($val->getName())."</td><td>".$value."</td><td style='$style'>".$txt."</td></tr>";
     $i++;
   }
-  echo "</table>Total tags: $i</span><hr>";
+  $page2.="</table>Total tags: $i</div><hr>";
+
 
   $i=0;
   $j=0;
-  echo "<span style='font-family:monospace;'>JpegMetaData - known tags<br>";
-  echo "<table style='border:1px solid #000000;'>";
-  echo "<tr style='border-bottom:1x solid #000000;'><th>Key</th><th>Name</th><th>Implemented</th></tr>";
-  foreach($jpegmd->getTagList(Array('filter' => JpegMetaData::TAGFILTER_ALL, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val)
+  $page2.="<div style='font-family:monospace;'>JpegMetaData - known tags<br>";
+  $page2.="<table style='border:1px solid #000000;width:100%;'>";
+  $page2.="<tr style='border-bottom:1x solid #000000;'><th>Key</th><th>Name</th><th>Implemented</th></tr>";
+  foreach(JpegMetaData::getTagList(Array('filter' => JpegMetaData::TAGFILTER_ALL, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val)
   {
     $val['implemented']?$i++:$j++;
-    echo "<tr><td>".$key."</td><td>".Locale::get($val['name'])."</td><td>".($val['implemented']?"yes":"no")."</td></tr>";
-  }
-  echo "</table>Total tags ; implemented: $i - not implemented: $j</span><hr>";
+    $page2.="<tr><td>".$key."</td><td>".Locale::get($val['name'])."</td><td>".($val['implemented']?"yes":"no")."</td></tr>";
+  }
+  $page2.="</table>Total tags ; implemented: $i - not implemented: $j</span><hr>";
 
   unset($jpegmd);
   unset($jpeg);
   $memory2=memory_get_usage();
-  echo "memory : ".$memory2." (memory leak ? = ".($memory2-$memory).")<br>";
-  echo "<br/></body></html>";
+  $page.="parsing time : ".($time2-$time)."<br>";
+  $page.="memory on start : ".$memory."<br>";
+  $page.="memory on end : ".$memory2." (memory leak ? = ".($memory2-$memory).")<br><br>";
+
+  $page.=$page2;
+  $page.="<br/></body></html>";
+
+  echo $page;
 ?>
