Index: /extensions/AMetaData/JpegMetaData/Common/GlobalTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Common/GlobalTags.class.php	(revision 5038)
+++ /extensions/AMetaData/JpegMetaData/Common/GlobalTags.class.php	(revision 5038)
@@ -0,0 +1,162 @@
+<?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.                                                                  |
+ * +-----------------------------------------------------------------------+
+ *
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Used to stock some var we want to be accessed over all the metadata parsing
+ * process
+ *
+ * Using a class prevent to declare "global" variables
+ * Using a class allows to use methods rather than a direct access to the variable
+ * calling a static function from an object is more understandable in the code
+ * than affect a valu to an unknown global var
+ *
+ * This class provides theses public functions :
+ *  - (static) setExifMaker
+ *  - (static) getExifMaker
+ *  - (static) setFocal
+ *  - (static) setAperture
+ *
+ * -----------------------------------------------------------------------------
+ */
+
+
+  Class GlobalTags
+  {
+    static private $exifMaker = "";
+    static private $exifFocal = "";
+    static private $exifAperture = "";
+
+    /**
+     * this function is used by IFD Reader to store all information about maker
+     * and camera model
+     *
+     * the stored value if used within a grep like "/canon/i" to determine the
+     * maker note.
+     * For more information about this tricks see the how the tag 0x927c is
+     * managed in the function "processSpecialTag" of the file
+     * IfdReader.class.php
+     *
+     * @param String $value : the maker or the camera model
+     */
+    static public function setExifMaker($value)
+    {
+      if(is_array($value))
+      {
+        foreach($value as $val)
+        {
+          self::$exifMaker.=$val." ";
+        }
+      }
+      else
+      {
+        self::$exifMaker.=$value." ";
+      }
+      return(self::$exifMaker);
+    }
+
+    /**
+     * this function is used by IFD Reader to store all information about maker
+     * and camera model
+     *
+     * @return String
+     */
+    static public function getExifMaker()
+    {
+      return(self::$exifMaker);
+    }
+
+
+    /**
+     * this function is used by IFD Reader to store information about the focal
+     * used to shoot
+     *
+     * the stored value if used within the pentax reader, to know the lens used
+     * with the camera (if lens Id returns more than one lens)
+     *
+     * For more information about this tricks see the how the tag 0x003f is
+     * managed in the function "processSpecialTag" of the file
+     * PentaxReader.class.php
+     *
+     * @param String $value : the focal
+     */
+    static public function setExifFocal($value)
+    {
+      self::$exifFocal=$value;
+      return(self::$exifFocal);
+    }
+
+    /**
+     * this function is used by Pentax Reader to know the focal value used to
+     * shoot
+     *
+     * @return String
+     */
+    static public function getExifFocal()
+    {
+      return(self::$exifFocal);
+    }
+
+
+    /**
+     * this function is used by IFD Reader to store information about the
+     * aperture used to shoot
+     *
+     * the stored value if used within the pentax reader, to know the lens used
+     * with the camera (if lens Id returns more than one lens)
+     *
+     * For more information about this tricks see the how the tag 0x003f is
+     * managed in the function "processSpecialTag" of the file
+     * PentaxReader.class.php
+     *
+     * @param String $value : the aperture
+     */
+    static public function setExifAperture($value)
+    {
+      self::$exifAperture=$value;
+      return(self::$exifAperture);
+    }
+
+    /**
+     * this function is used by Pentax Reader to know the aperture value used to
+     * shoot
+     *
+     * @return String
+     */
+    static public function getExifAperture()
+    {
+      return(self::$exifAperture);
+    }
+
+  }
+
+  ?>
Index: /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php	(revision 5038)
@@ -37,6 +37,4 @@
  * This class provides theses public functions :
  *  - (static) getMaker
- *  - (static) setExifMaker
- *  - (static) getExifMaker
  *
  * -----------------------------------------------------------------------------
@@ -91,5 +89,4 @@
     const UnknownHeaderSize   = 0;
 
-    static private $exifMaker = "";
 
     static public function getMaker($datas)
@@ -121,43 +118,4 @@
     }
 
-    /**
-     * this function is used by IFD Reader to store all information about maker
-     * and camera model
-     *
-     * the stored value if used within a grep like "/canon/i" to determine the
-     * maker note.
-     * For more information about this tricks see the how the tag 0x927c is
-     * managed in the function "processSpecialTag" of the file
-     * IfdReader.class.php
-     *
-     * @param String $value : the maker or the camera model
-     */
-    static public function setExifMaker($value)
-    {
-      if(is_array($value))
-      {
-        foreach($value as $val)
-        {
-          self::$exifMaker.=$val." ";
-        }
-      }
-      else
-      {
-        self::$exifMaker.=$value." ";
-      }
-      return(self::$exifMaker);
-    }
-
-    /**
-     * this function is used by IFD Reader to store all information about maker
-     * and camera model
-     *
-     * @return String
-     */
-    static public function getExifMaker()
-    {
-      return(self::$exifMaker);
-    }
-
   }
 
Index: /extensions/AMetaData/JpegMetaData/Readers/CanonReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/CanonReader.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/Readers/CanonReader.class.php	(revision 5038)
@@ -412,5 +412,5 @@
     protected function processSubTag0x000d($values, $add=true)
     {
-      $name=MakerNotesSignatures::getExifMaker();
+      $name=GlobalTags::getExifMaker();
 
       if(preg_match("/\b1DS?$/", $name))
Index: /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/Readers/IfdReader.class.php	(revision 5038)
@@ -71,4 +71,5 @@
 
   require_once(JPEG_METADATA_DIR."Common/Data.class.php");
+  require_once(JPEG_METADATA_DIR."Common/GlobalTags.class.php");
   require_once(JPEG_METADATA_DIR."Common/MakerNotesSignatures.class.php");
   require_once(JPEG_METADATA_DIR."Readers/GenericReader.class.php");
@@ -362,5 +363,5 @@
            */
           $returned=ConvertData::toStrings($values);
-          MakerNotesSignatures::setExifMaker($returned);
+          GlobalTags::setExifMaker($returned);
           break;
         case 0x011A: // XResolution, tag 0x011A
@@ -414,5 +415,5 @@
         case 0x829D: // FNumber, tag 0x829D
           if($values[1]==0) $values[1]=1;
-          $returned=ConvertData::toFNumber($values[0]/$values[1]);
+          $returned=ConvertData::toFNumber(GlobalTags::setExifAperture($values[0]/$values[1]));
           break;
         case 0x8769: // Exif IFD Pointer, tag 0x8769
@@ -480,4 +481,12 @@
           break;
         case 0x9202: // ApertureValue, tag0x9202
+          if($values[1]==0) $values[1]=1;
+          if(GlobalTags::getExifAperture()=="")
+          {
+            // set only if empty (if not empty, it means the value was already
+            // set with the FNumber tag)
+            GlobalTags::setExifAperture(pow(1.414213562, $values[0]/$values[1]));
+          }
+          //no break, $returned value is the same than the 0x9205 tag
         case 0x9205: // MaxApertureValue, tag0x9205
           if($values[1]==0) $values[1]=1;
@@ -517,5 +526,5 @@
         case 0x920A: // FocalLength, tag 0x920A
           if($values[1]==0) $values[1]=1;
-          $returned=ConvertData::toFocalLength($values[0]/$values[1]);
+          $returned=ConvertData::toFocalLength(GlobalTags::setExifFocal($values[0]/$values[1]));
           break;
         case 0x927c: // MakerNote, tag 0x927c
@@ -561,5 +570,5 @@
                * the camera model contains "Canon"
                */
-              if(preg_match("/.*canon.*/i",MakerNotesSignatures::getExifMaker()))
+              if(preg_match("/.*canon.*/i",GlobalTags::getExifMaker()))
               {
                 require_once(JPEG_METADATA_DIR."Readers/CanonReader.class.php");
Index: /extensions/AMetaData/JpegMetaData/Readers/NikonReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/NikonReader.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/Readers/NikonReader.class.php	(revision 5038)
@@ -347,5 +347,5 @@
           }
 
-          if(preg_match("/.*d70.*/i",MakerNotesSignatures::getExifMaker()))
+          if(preg_match("/.*d70.*/i",GlobalTags::getExifMaker()))
           {
             $bit5=1;
@@ -376,13 +376,10 @@
           break;
         case 0x0098: // "LensData"
-          if($this->shutterCount==-1 or $this->serialNumber=="")
+          if(($this->shutterCount==-1 or $this->serialNumber=="") and
+            ( substr($values,0,2)=="02" ))
           {
             $this->toDecode[0x0098]=Array($values, $type);
-            $returned="";
-          }
-          else
-          {
-            $returned=$this->readLensData($values);
-          }
+          }
+          $returned=$this->readLensData($values);
           break;
         case 0x0099: // "RawImageCenter"
@@ -481,4 +478,6 @@
       }
 
+      if(is_array($returned))
+        $returned=$returned[0];
 
       unset($data);
@@ -567,5 +566,5 @@
         return(0+$this->serialNumber);
       }
-      elseif(preg_match("/.*d50.*/i",MakerNotesSignatures::getExifMaker()))
+      elseif(preg_match("/.*d50.*/i",GlobalTags::getExifMaker()))
       {
         //D50
Index: /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/Readers/PentaxReader.class.php	(revision 5038)
@@ -54,4 +54,5 @@
 
 
+  require_once(JPEG_METADATA_DIR."Common/GlobalTags.class.php");
   require_once(JPEG_METADATA_DIR."TagDefinitions/PentaxTags.class.php");
   require_once(JPEG_METADATA_DIR."Readers/MakerNotesReader.class.php");
@@ -232,4 +233,82 @@
         case 0x003e: // "PreviewImageBorders",
           $returned=ConvertData::toHexDump($values, ByteType::UBYTE);
+          break;
+        case 0x003f: // "LensType",
+          $tag=$this->tagDef->getTagById(0x003f);
+          $id=$values[1]+($values[0]<<8);
+          if(!array_key_exists($id, $tag['tagValues.special'])) $id=0xffff;
+
+          $returned="";
+
+          $lensesList=$tag['tagValues.special'][$id];
+          if(is_array($lensesList))
+          {
+            foreach($lensesList as $lens)
+            {
+              /*
+               * If there is more than one lens associated with a lens id
+               *
+               * 1/ try to found the min/max focals of the lens
+               * 2/ try to found the min/max aperture of the lens
+               * 3/ if focal is fixed, make min = max
+               * 4/ if aperture is constant, make min)max
+               * 5/ look if : min focal <= photo focal <= max focal  and
+               *              photo aperture >= min aperture
+               *            if yes, the lens is returned, otherwise test next
+               *            lens
+               */
+              preg_match("/.*\s(?:([0-9]+){1}(?:-([0-9]+))?)mm.*/i", $lens, $focals);
+              preg_match("/.*\sF(?:([0-9\.]+){1}(?:-([0-9\.]+))?).*/i", $lens, $apertures);
+
+              if(count($focals)==2)
+              {
+                //focal is not a zoom, min = max
+                $focals[]=$focal[1];
+              }
+              elseif(count($focals)==0)
+              {
+                $focal=Array(0,0,0);
+              }
+
+
+              if(count($apertures)==2)
+              {
+                //aperture is constant, min = max
+                $apertures[]=$apertures[1];
+              }
+              elseif(count($apertures)==0)
+              {
+                $apertures=Array(0,0,0);
+              }
+
+              $focal=GlobalTags::getExifFocal();
+              if($focal=="") $focal=-1;
+
+              $aperture=GlobalTags::getExifAperture();
+              if($aperture=="") $aperture=-1;
+
+              if($focals[1]<=$focal && $focal<=$focals[2] && $aperture>=$apertures[1] && $returned=="")
+              {
+                $returned=$lens;
+              }
+
+              unset($lens);
+              unset($focals);
+              unset($apertures);
+            }
+            if($returned=="")
+            {
+              // no lens seems to be valid, returns the lens list
+              $returned=$lensesList;
+            }
+          }
+          else
+          {
+            // not a list, just a single lens
+            $returned=$lensesList;
+          }
+
+          unset($tag);
+          unset($id);
           break;
         case 0x0040: // "SensitivityAdjust", from exiftool
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php	(revision 5038)
@@ -146,4 +146,5 @@
         'tagValues'    => Array(
           "{exif.Pentax.LensType}",
+          "{exif.Nikon.LensData}",
           "{exif.Nikon.Lens}",
           "{exif.Canon.CanonCameraSettings.LensType}",
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/NikonTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/NikonTags.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/NikonTags.class.php	(revision 5038)
@@ -679,5 +679,5 @@
         'tagName'     => "LensData",
         'schema'      => "Nikon",
-        'translatable'=> true,
+        'translatable'=> false,
         'combiTag'    => 0,
         'implemented' => true,
@@ -734,5 +734,19 @@
           '2D 48 80 80 30 30 21 02' => 'AF Micro-Nikkor 200mm f/4D IF-ED',
           '2E 48 5C 82 30 3C 28 02' => 'AF Nikkor 70-210mm f/4-5.6D',
-          '2F 48 30 44 24 24 29 02' => 'AF Zoom-Nikkor 20-35mm f/2.8D IF',  //doublon?
+          '2F 48 30 44 24 24 29 02' => Array(
+            /*
+             * Different lenses can have the same Id.
+             * The Nikon Id are made with the focal min/max and the aperture
+             * min/max values.
+             *
+             * So, it's not possible to apply the method used with the Canon
+             * lens Id.
+             *
+             * For multiple lenses with the same key, the method used is to
+             * return the first lens
+             */
+                                          'AF Zoom-Nikkor 20-35mm f/2.8D IF',
+                                          'Tokina AT-X 235 AF PRO (AF 20-35mm f/2.8)',
+                                       ),
           '30 48 98 98 24 24 24 02' => 'AF-I Nikkor 400mm f/2.8D IF-ED',
           '30 48 98 98 24 24 F1 02' => 'AF-I Nikkor 400mm f/2.8D IF-ED + TC-14E',
@@ -740,5 +754,9 @@
           '30 48 98 98 24 24 F2 02' => 'AF-I Nikkor 400mm f/2.8D IF-ED + TC-20E',
           '31 54 56 56 24 24 25 02' => 'AF Micro-Nikkor 60mm f/2.8D',
-          '32 54 6A 6A 24 24 35 02' => 'AF Micro-Nikkor 105mm f/2.8D', //doublon?
+
+          '32 54 6A 6A 24 24 35 02' => Array(
+                                          'AF Micro-Nikkor 105mm f/2.8D',
+                                          'Sigma Macro 105mm f/2.8 EX DG',
+                                       ),
           '33 48 2D 2D 24 24 31 02' => 'AF Nikkor 18mm f/2.8D',
           '34 48 29 29 24 24 32 02' => 'AF Fisheye Nikkor 16mm f/2.8D',
@@ -816,5 +834,8 @@
           '78 40 37 6E 2C 3C 7C 0E' => 'AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED',
           '79 40 3C 80 2C 3C 7F 06' => 'AF Zoom-Nikkor 28-200mm f/3.5-5.6G IF-ED',
-          '7A 3C 1F 37 30 30 7E 06' => 'AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED', //doublon ?
+          '7A 3C 1F 37 30 30 7E 06' => Array(
+                                        'AF-S DX Zoom-Nikkor 12-24mm f/4G IF-ED',
+                                        'Tokina AT-X 124 AF PRO DX II (AF 12-24mm f/4)',
+                                       ),
           '7B 48 80 98 30 30 80 0E' => 'AF-S VR Zoom-Nikkor 200-400mm f/4G IF-ED',
           '7D 48 2B 53 24 24 82 06' => 'AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED',
@@ -874,5 +895,4 @@
           '79 48 5C 5C 24 24 1C 06' => 'Sigma Macro 70mm F2.8 EX DG',
           '02 48 65 65 24 24 02 00' => 'Sigma 90mm F2.8 Macro',
-          '32 54 6A 6A 24 24 35 02' => 'Sigma Macro 105mm F2.8 EX DG', //doublon ?
           'E5 54 6A 6A 24 24 35 02' => 'Sigma Macro 105mm F2.8 EX DG',
           '48 48 76 76 24 24 4B 06' => 'Sigma 150mm F2.8 EX DG APO Macro HSM',
@@ -1005,8 +1025,6 @@
           '00 48 1C 29 24 24 00 06' => 'Tokina AT-X 116 PRO DX (AF 11-16mm f/2.8)',
           '00 3C 1F 37 30 30 00 06' => 'Tokina AT-X 124 AF PRO DX (AF 12-24mm f/4)',
-          '7A 3C 1F 37 30 30 7E 06' => 'Tokina AT-X 124 AF PRO DX II (AF 12-24mm f/4)', //doublon ?
           '00 48 29 50 24 24 00 06' => 'Tokina AT-X 165 PRO DX (AF 16-50mm f/2.8)',
           '00 40 2A 72 2C 3C 00 06' => 'Tokina AT-X 16.5-135 DX (AF 16.5-135mm F3.5-5.6)',
-          '2F 48 30 44 24 24 29 02' => 'Tokina AT-X 235 AF PRO (AF 20-35mm f/2.8)', //doublon ?
           '2F 40 30 44 2C 34 29 02' => 'Tokina AF 235 II (AF 20-35mm f/3.5-4.5)',
           '25 48 3C 5C 24 24 1B 02' => 'Tokina AT-X 270 AF PRO II (AF 28-70mm f/2.6-2.8)',
@@ -1081,5 +1099,5 @@
       // SerialNumber, tag 0x00a0
       0x00a0 => Array(
-        'tagName'     => "SerialNumber",
+        'tagName'     => "SerialNumber2",
         'schema'      => "Nikon",
         'translatable'=> false,
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php	(revision 5037)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/PentaxTags.class.php	(revision 5038)
@@ -862,9 +862,9 @@
         'combiTag'    => 2,
         'implemented' => true,
-        'tagValues'   => Array(
+        'tagValues.special'   => Array(
           0x0000 => "M-42 or No Lens",
           0x0100 => "K,M Lens",
           0x0200 => "A Series Lens",
-          0x0300 => "SIGMA",
+          0x0300 => "Sigma",
           0x0311 => "smc PENTAX-FA SOFT 85mm F2.8",
           0x0312 => "smc PENTAX-F 1.7X AF ADAPTER",
@@ -873,27 +873,67 @@
           0x0315 => "smc PENTAX-F 80-200mm F4.7-5.6",
           0x0316 => "smc PENTAX-F FISH-EYE 17-28mm F3.5-4.5",
-          0x0317 => "smc PENTAX-F 100-300mm F4.5-5.6",
+          0x0317 => Array(
+                      "smc PENTAX-F 100-300mm F4.5-5.6",
+                      "Sigma AF 28-300mm F3.5-5.6 DL IF",
+                      "Sigma AF 28-300mm F3.5-6.3 DG IF Macro",
+                    ),
           0x0318 => "smc PENTAX-F 35-135mm F3.5-4.5",
-          0x0319 => "smc PENTAX-F 35-105mm F4-5.6 or SIGMA or Tokina",
+          0x0319 => Array(
+                      "smc PENTAX-F 35-105mm F4-5.6",
+                      "Sigma AF 28-300mm F3.5-5.6 DL IF",
+                      "Sigma 55-200mm F4-5.6 DC",
+                      "Sigma AF 28-300mm F3.5-5.6 DL IF",
+                      "Sigma AF 28-300mm F3.5-6.3 DG IF Macro",
+                      "Tokina 80-200mm F2.8 ATX-Pro",
+                    ),
           0x031a => "smc PENTAX-F* 250-600mm F5.6 ED[IF]",
-          0x031b => "smc PENTAX-F 28-80mm F3.5-4.5",
-          0x031c => "smc PENTAX-F 35-70mm F3.5-4.5",
-          0x031d => "PENTAX-F 28-80mm F3.5-4.5 or SIGMA AF 18-125mm F3.5-5.6 DC",
+          0x031b => Array(
+                      "smc PENTAX-F 28-80mm F3.5-4.5",
+                      "Tokina AT-X Pro AF 28-70mm F2.6-2.8",
+                    ),
+          0x031c => Array(
+                      "smc PENTAX-F 35-70mm F3.5-4.5",
+                      "Tokina 19-35mm F3.5-4.5 AF",
+                    ),
+          0x031d => Array(
+                      "PENTAX-F 28-80mm F3.5-4.5",
+                      "Sigma AF 18-125mm F3.5-5.6 DC",
+                      "Tokina AT-X PRO 28-70mm F2.6-2.8",
+                    ),
           0x031e => "PENTAX-F 70-200mm F4-5.6",
-          0x031f => "smc PENTAX-F 70-210mm F4-5.6",
+          0x031f => Array(
+                      "smc PENTAX-F 70-210mm F4-5.6",
+                      "Tokina AF 730 75-300mm F4.5-5.6",
+                      "Takumar-F 70-210mm F4-5.6",
+                    ),
           0x0320 => "smc PENTAX-F 50mm F1.4",
           0x0321 => "smc PENTAX-F 50mm F1.7",
           0x0322 => "smc PENTAX-F 135mm F2.8 [IF]",
           0x0323 => "smc PENTAX-F 28mm F2.8",
-          0x0324 => "SIGMA 20mm F1.8 EX DG ASPHERICAL RF",
+          0x0324 => "Sigma 20mm F1.8 EX DG ASPHERICAL RF",
           0x0326 => "smc PENTAX-F* 300mm F4.5 ED[IF]",
           0x0327 => "smc PENTAX-F* 600mm F4 ED[IF]",
           0x0328 => "smc PENTAX-F MACRO 100mm F2.8",
-          0x0329 => "smc PENTAX-F MACRO 50mm F2.8 or Sigma 50mm F2,8 MACRO",
-          0x032c => "Tamron 35-90mm F4 AF or various SIGMA models",
-          0x032e => "SIGMA APO 70-200mm F2.8 EX",
+          0x0329 => Array(
+                      "smc PENTAX-F MACRO 50mm F2.8",
+                      "Sigma 50mm F2.8 Macro",
+                    ),
+          0x032c => Array(
+                      "Tamron 35-90mm F4 AF",
+                      "Sigma AF 10-20mm F4-5.6 EX DC",
+                      "Sigma 12-24mm F4.5 EX DG",
+                      "Sigma 17-70mm F2.8-4.5 DC Macro",
+                      "Sigma 18-50mm F3.5-5.6 DC",
+                    ),
+          0x032e => Array(
+                      "Sigma APO 70-200mm F2.8 EX",
+                      "Sigma EX APO 100-300mm F4 IF",
+                    ),
           0x0332 => "smc PENTAX-FA 28-70mm F4 AL",
-          0x0333 => "SIGMA 28mm F1.8 EX DG ASPHERICAL MACRO",
-          0x0334 => "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]",
+          0x0333 => "Sigma 28mm F1.8 EX DG ASPHERICAL MACRO",
+          0x0334 => Array(
+                      "smc PENTAX-FA 28-200mm F3.8-5.6 AL[IF]",
+                      "Tamron AF LD 28-200mm F3.8-5.6 [IF] Aspherical (171D)",
+                    ),
           0x0335 => "smc PENTAX-FA 28-80mm F3.5-5.6 AL",
           0x03f7 => "smc PENTAX-DA FISH-EYE 10-17mm F3.5-4.5 ED[IF]",
@@ -904,5 +944,15 @@
           0x03fd => "smc PENTAX-DA 14mm F2.8 ED[IF]",
           0x03fe => "smc PENTAX-DA 16-45mm F4 ED AL",
-          0x03ff => "SIGMA",
+          0x03ff => Array(
+                      "Sigma 18-200mm F3.5-6.3 DC",
+                      "Sigma DL-II 35-80mm F4-5.6",
+                      "Sigma DL Zoom 75-300mm F4-5.6",
+                      "Sigma DF EX Aspherical 28-70mm F2.8",
+                      "Sigma AF Tele 400mm F5.6 Multi-coated",
+                      "Sigma 24-60mm F2.8 EX DG",
+                      "Sigma 70-300mm F4-5.6 Macro",
+                      "Sigma 55-200mm F4-5.6 DC",
+                      "Sigma 18-50mm F2.8 EX DC",
+                    ),
           0x0401 => "smc PENTAX-FA SOFT 28mm F2.8",
           0x0402 => "smc PENTAX-FA 80-320mm F4.5-5.6",
@@ -911,28 +961,34 @@
           0x040c => "smc PENTAX-FA 50mm F1.4",
           0x040f => "smc PENTAX-FA 28-105mm F4-5.6 [IF]",
-          0x0410 => "TAMRON AF 80-210mm F4-5.6 (178D)",
-          0x0413 => "TAMRON SP AF 90mm F2.8 (172E)",
+          0x0410 => "Tamron AF 80-210mm F4-5.6 (178D)",
+          0x0413 => "Tamron SP AF 90mm F2.8 (172E)",
           0x0414 => "smc PENTAX-FA 28-80mm F3.5-5.6",
           0x0416 => "TOKINA 28-80mm F3.5-5.6",
           0x0417 => "smc PENTAX-FA 20-35mm F4 AL",
           0x0418 => "smc PENTAX-FA 77mm F1.8 Limited",
-          0x0419 => "TAMRON SP AF 14mm F2.8",
-          0x041a => "smc PENTAX-FA MACRO 100mm F3.5",
-          0x041b => "TAMRON AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)",
+          0x0419 => "Tamron SP AF 14mm F2.8",
+          0x041a => Array(
+                      "smc PENTAX-FA MACRO 100mm F3.5",
+                      "Cosina 100mm F3.5 Macro",
+                    ),
+          0x041b => "Tamron AF28-300mm F/3.5-6.3 LD Aspherical[IF] MACRO (285D)",
           0x041c => "smc PENTAX-FA 35mm F2 AL",
-          0x041d => "TAMRON AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)",
+          0x041d => "Tamron AF 28-200mm F/3.8-5.6 LD Super II MACRO (371D)",
           0x0422 => "smc PENTAX-FA 24-90mm F3.5-4.5 AL[IF]",
           0x0423 => "smc PENTAX-FA 100-300mm F4.7-5.8",
-          0x0424 => "TAMRON AF70-300mm F/4-5.6 LD MACRO",
-          0x0425 => "TAMRON SP AF 24-135mm F3.5-5.6 AD AL (190D)",
+          0x0424 => "Tamron AF70-300mm F/4-5.6 LD MACRO",
+          0x0425 => "Tamron SP AF 24-135mm F3.5-5.6 AD AL (190D)",
           0x0426 => "smc PENTAX-FA 28-105mm F3.2-4.5 AL[IF]",
           0x0427 => "smc PENTAX-FA 31mm F1.8AL Limited",
-          0x0429 => "TAMRON AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)",
+          0x0429 => "Tamron AF 28-200mm Super Zoom F3.8-5.6 Aspherical XR [IF] MACRO (A03)",
           0x042b => "smc PENTAX-FA 28-90mm F3.5-5.6",
           0x042c => "smc PENTAX-FA J 75-300mm F4.5-5.8 AL",
-          0x042d => "TAMRON 28-300mm F3.5-6.3 Ultra zoom XR",
+          0x042d => Array(
+                      "Tamron AF 28-300mm F3.5-6.3 XR Di LD Aspherical [IF] Macro",
+                      "Tamron 28-300mm F3.5-6.3 Ultra zoom XR",
+                    ),
           0x042e => "smc PENTAX-FA J 28-80mm F3.5-5.6 AL",
           0x042f => "smc PENTAX-FA J 18-35mm F4-5.6 AL",
-          0x0431 => "TAMRON SP AF 28-75mm F2.8 XR Di (A09)",
+          0x0431 => "Tamron SP AF 28-75mm F2.8 XR Di (A09)",
           0x0433 => "smc PENTAX-D FA 50mm F2.8 MACRO",
           0x0434 => "smc PENTAX-D FA 100mm F2.8 MACRO",
@@ -949,5 +1005,5 @@
           0x04f7 => "smc PENTAX-DA 10-17mm F3.5-4.5 ED [IF] Fisheye zoom",
           0x04f8 => "smc PENTAX-DA 12-24mm F4 ED AL [IF]",
-          0x04f9 => "TAMRON XR DiII 18-200mm F3.5-6.3 (A14)",
+          0x04f9 => "Tamron XR DiII 18-200mm F3.5-6.3 (A14)",
           0x04fa => "smc PENTAX-DA 50-200mm F4-5.6 ED",
           0x04fb => "smc PENTAX-DA 40mm F2.8 Limited",
@@ -998,8 +1054,8 @@
           0x07e7 => "smc PENTAX-DA 18-250mm F3.5-6.3ED AL [IF]",
           0x07e9 => "smc PENTAX-DA 35mm F2.8 Macro Limited",
-          0x07ea => "smc PENTAX-DA* 300 mm F4ED [IF] SDM (SDM not used)",
+          0x07ea => "smc PENTAX-DA* 300mm F4ED [IF] SDM (SDM not used)",
           0x07eb => "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM (SDM not used)",
           0x07ec => "smc PENTAX-DA 55-300mm F4-5.8 ED", //from exiftool
-          0x07ee => "TAMRON AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO",
+          0x07ee => "Tamron AF 18-250mm F3.5-6.3 Di II LD Aspherical [IF] MACRO",
           0x07f1 => "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM (SDM not used)",
           0x07f2 => "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM not used)",
@@ -1009,10 +1065,14 @@
           0x08e3 => "smc PENTAX DA* 60-250mm F4 [IF] SDM", //from exiftool
           0x08e8 => "smc PENTAX-DA 17-70mm F4 AL [IF] SDM", //from exiftool
-          0x08ea => "smc PENTAX-DA* 300 mm F4ED [IF] SDM",
+          0x08ea => "smc PENTAX-DA* 300mm F4ED [IF] SDM",
           0x08eb => "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM",
           0x08f1 => "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM",
           0x08f2 => "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM",
-          0x08ff => "Sigma lens" //from exiftool
-        )
+          0x08ff => Array(
+                      "Sigma 70-200mm F2.8 EX DG Macro HSM II",
+                      "Sigma APO 150-500mm F5-6.3 DG OS HSM",
+                    ),
+          0xffff => "Unknown",
+        ),
       ), // < LensType
 
