From: Michael J. Rubinsky Date: Mon, 15 Feb 2010 17:48:08 +0000 (-0500) Subject: Ignore the Maker:DataDump tag when using Exiftool. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=da7a3a1f3b7a5704bbfdbaab52656499c4b29f3e;p=horde.git Ignore the Maker:DataDump tag when using Exiftool. 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... --- diff --git a/framework/Image/lib/Horde/Image/Exif/Exiftool.php b/framework/Image/lib/Horde/Image/Exif/Exiftool.php index 37264ea25..b47ffc99a 100644 --- a/framework/Image/lib/Horde/Image/Exif/Exiftool.php +++ b/framework/Image/lib/Horde/Image/Exif/Exiftool.php @@ -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);