Index: /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php	(revision 6985)
+++ /extensions/AMetaData/JpegMetaData/Common/MakerNotesSignatures.class.php	(revision 6986)
@@ -92,25 +92,25 @@
     static public function getMaker($datas)
     {
-      if(substr_compare($datas, self::OlympusHeader, 0, self::OlympusHeaderSize)===0)
+      if(strlen($datas) >= self::OlympusHeaderSize and substr_compare($datas, self::OlympusHeader, 0, self::OlympusHeaderSize)===0)
        { return(self::OlympusHeader); }
-      elseif(substr_compare($datas, self::Olympus2Header, 0, self::Olympus2HeaderSize)===0)
+      elseif(strlen($datas) >= self::Olympus2HeaderSize and substr_compare($datas, self::Olympus2Header, 0, self::Olympus2HeaderSize)===0)
        { return(self::Olympus2Header); }
-      elseif(substr_compare($datas, self::FujiFilmHeader, 0, self::FujiFilmHeaderSize)===0)
+      elseif(strlen($datas) >= self::FujiFilmHeaderSize and substr_compare($datas, self::FujiFilmHeader, 0, self::FujiFilmHeaderSize)===0)
        { return(self::FujiFilmHeader); }
-      elseif(substr_compare($datas, self::Nikon2Header, 0, self::Nikon2HeaderSize)===0)
+      elseif(strlen($datas) >= self::Nikon2HeaderSize and substr_compare($datas, self::Nikon2Header, 0, self::Nikon2HeaderSize)===0)
        { return(self::Nikon2Header); }
-      elseif(substr_compare($datas, self::Nikon3Header, 0, self::Nikon3HeaderSize)===0)
+      elseif(strlen($datas) >= self::Nikon3HeaderSize and substr_compare($datas, self::Nikon3Header, 0, self::Nikon3HeaderSize)===0)
        { return(self::Nikon3Header); }
-      elseif(substr_compare($datas, self::PanasonicHeader, 0, self::PanasonicHeaderSize)===0)
+      elseif(strlen($datas) >= self::PanasonicHeaderSize and substr_compare($datas, self::PanasonicHeader, 0, self::PanasonicHeaderSize)===0)
        { return(self::PanasonicHeader); }
-      elseif(substr_compare($datas, self::PentaxHeader, 0, self::PentaxHeaderSize)===0)
+      elseif(strlen($datas) >= self::PentaxHeaderSize and substr_compare($datas, self::PentaxHeader, 0, self::PentaxHeaderSize)===0)
        { return(self::PentaxHeader); }
-      elseif(substr_compare($datas, self::Pentax2Header, 0, self::Pentax2HeaderSize)===0)
+      elseif(strlen($datas) >= self::Pentax2HeaderSize and substr_compare($datas, self::Pentax2Header, 0, self::Pentax2HeaderSize)===0)
        { return(self::Pentax2Header); }
-      elseif(substr_compare($datas, self::SigmaHeader, 0, self::SigmaHeaderSize)===0)
+      elseif(strlen($datas) >= self::SigmaHeaderSize and substr_compare($datas, self::SigmaHeader, 0, self::SigmaHeaderSize)===0)
        { return(self::SigmaHeader); }
-      elseif(substr_compare($datas, self::Sigma2Header, 0, self::Sigma2HeaderSize)===0)
+      elseif(strlen($datas) >= self::Sigma2HeaderSize and substr_compare($datas, self::Sigma2Header, 0, self::Sigma2HeaderSize)===0)
        { return(self::Sigma2Header); }
-      elseif(substr_compare($datas, self::SonyHeader, 0, self::SonyHeaderSize)===0)
+      elseif(strlen($datas) >= self::SonyHeaderSize and substr_compare($datas, self::SonyHeader, 0, self::SonyHeaderSize)===0)
        { return(self::SonyHeader); }
       else
Index: /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php	(revision 6985)
+++ /extensions/AMetaData/JpegMetaData/JpegMetaData.class.php	(revision 6986)
@@ -68,10 +68,11 @@
  * |         |            |
  * |         |            | * mantis bug:1859
- * |         |            |   . JpegMetadata class can't manage multiple IPTC
+ * |         |            |   . JpegMetadata class can't manage multiple IPTC keywords
  * |         |            |     keywords
  * |         |            |
- * |         |            | * mantis bug:1861
- * |         |            |   . Accentued chars from ISO-8859-1 charset are not
- * |         |            |     recognized
+ * |         |            | * mantis bug:1870
+ * |         |            |   . Xmp ISOSpeedRatings was not interpreted by
+ * |         |            |     'Magic' metadata
+ * |         |            |
  * |         |            |
  * |         |            |
@@ -628,5 +629,5 @@
 
     /**
-     * MagicTags are build with this function
+     * MagicTags are built with this function
      */
     protected function processMagicTags()
@@ -650,9 +651,11 @@
           if($found)
           {
-            $returned=trim(preg_replace_callback(
+            $returned=trim(
+              preg_replace_callback(
                 '/{([a-z0-9:\.\s\/\[\]]*)}/i',
                 Array(&$this, "processMagicTagsCB"),
                 $val['tagValues'][$i]
-            ));
+              )
+            );
 
             $returned=$this->processSpecialMagicTag($key, $returned);
@@ -718,5 +721,4 @@
         }
       }
-
       if($label instanceof DateTime)
         return($label->format("Y-m-d H:i:s"));
@@ -725,5 +727,7 @@
 
       if(is_array($label))
+      {
         return(implode(", ", $label));
+      }
 
       return(trim($label));
Index: /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php	(revision 6985)
+++ /extensions/AMetaData/JpegMetaData/Readers/XmpReader.class.php	(revision 6986)
@@ -246,5 +246,5 @@
               break;
           }
-          if($type=="seq" or $type=="bag" or $type="alt")
+          if($type=="seq" or $type=="bag" or $type=="alt")
           {
             $value=Array('type' => $type, 'values' => Array());
Index: /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php
===================================================================
--- /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php	(revision 6985)
+++ /extensions/AMetaData/JpegMetaData/TagDefinitions/MagicTags.class.php	(revision 6986)
@@ -116,5 +116,5 @@
         'tagValues'    => Array(
           "{exif.exif.ISOSpeedRatings}",
-          "{xmp.exif:ISOSpeedRatings}",
+          "{xmp.exif:ISOSpeedRatings[values]}",
           "{exif.Pentax.ISO}",
         )
