Ignore the Maker:DataDump tag when using Exiftool.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 17:48:08 +0000 (12:48 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 15 Feb 2010 17:48:08 +0000 (12:48 -0500)
Exiftool outputs this data as binary which breaks the json encoding. It's
also not used anywhere anyway. It might even be better in the future to
explicitly indicate what tags we want for performance reasons...might not be
worth the extra maintenance though...

framework/Image/lib/Horde/Image/Exif/Exiftool.php

index 37264ea..b47ffc9 100644 (file)
@@ -37,12 +37,14 @@ class Horde_Image_Exif_Exiftool extends Horde_Image_Exif_Base
     {
         // Request the full stream of meta data in JSON format.
         // -j option outputs in JSON, -n = prevent screen formatting
-        $command = '-j -n ' . $image;
+        // -x DataDump prevents the binary DataDump field from some cameras from
+        // being included. It messes up the JSON decoding, and it's not used
+        // anywhere anyway.
+        $command = '-j -n -x MakerNotes:DataDump ' . $image;
         $results = json_decode($this->_execute($command));
         if (is_array($results)) {
             $results = array_pop($results);
         }
-
         // Return as an array since that's what all the other Exif classes do...
         if ($results instanceof stdClass) {
             return $this->_processData((array)$results);