From: Michael J. Rubinsky Date: Mon, 3 Aug 2009 23:15:46 +0000 (-0400) Subject: silly me... just use the '-n' option to prevent exiftool from formatting X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9d8dcfe11bb1906fe3bce86e6c661312568949e0;p=horde.git silly me... just use the '-n' option to prevent exiftool from formatting in the first place. --- diff --git a/framework/Image/lib/Horde/Image/Exif/Base.php b/framework/Image/lib/Horde/Image/Exif/Base.php index 14117e125..bea1cc203 100644 --- a/framework/Image/lib/Horde/Image/Exif/Base.php +++ b/framework/Image/lib/Horde/Image/Exif/Base.php @@ -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; diff --git a/framework/Image/lib/Horde/Image/Exif/Exiftool.php b/framework/Image/lib/Horde/Image/Exif/Exiftool.php index 450cbd084..1c643cfaf 100644 --- a/framework/Image/lib/Horde/Image/Exif/Exiftool.php +++ b/framework/Image/lib/Horde/Image/Exif/Exiftool.php @@ -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)) {