silly me... just use the '-n' option to prevent exiftool from formatting
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 3 Aug 2009 23:15:46 +0000 (19:15 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 3 Aug 2009 23:16:24 +0000 (19:16 -0400)
in the first place.

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

index 14117e1..bea1cc2 100644 (file)
@@ -101,9 +101,11 @@ abstract class Horde_Image_Exif_Base
         // According to EXIF standard, GPS data can be in the form of
         // dd/1 mm/1 ss/1 or as a decimal reprentation.
         if (!is_array($data)) {
-            // Assume a scalar is a decimeal representation - but strip it of
+            // Assume a scalar is a decimal representation - but strip it of
             // any stray characters that may be there.
-            return (double)trim(str_replace(array('N', 'S', 'E', 'W', '"'), array('', '', '', '', ''), $data));
+            return (double)trim(str_replace(array('N', 'S', 'E', 'W'),
+                                            array('', '', '', ''),
+                                            $data));
         }
         if ($data[0] == 0) {
             return 0;
index 450cbd0..1c643cf 100644 (file)
@@ -36,7 +36,8 @@ class Horde_Image_Exif_Exiftool extends Horde_Image_Exif_Base
     public function getData($image)
     {
         // Request the full stream of meta data in JSON format.
-        $command = '-j -c "%.6f ' . $image;
+        // -j option outputs in JSON, -n = prevent screen formatting
+        $command = '-j -n ' . $image;
         $test = $this->_execute($command);
         $results = json_decode($this->_execute($command));
         if (is_array($results)) {