Add formatting for the UserComment field along with a TODO note
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Aug 2009 20:45:49 +0000 (16:45 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 1 Aug 2009 20:45:49 +0000 (16:45 -0400)
framework/Image/lib/Horde/Image/Exif.php

index b65da12..e35c7f4 100644 (file)
@@ -399,6 +399,15 @@ class Horde_Image_Exif
         case 'DateTimeDigitized':
             return date('m/d/Y H:i:s O', $data);
 
+        case 'UserComment':
+            //@TODO: the first 8 bytes of this field contain the charset used
+            //       to encode the comment. Either ASCII, JIS, UNICODE, or
+            //       UNDEFINED. Should probably either convert to a known charset
+            //       here and let the calling code deal with it, or allow this
+            //       method to take an optional charset to convert to (would
+            //       introduce a dependency on Horde_String to do the conversion).
+            return substr($data, 7);
+
         default:
             return $data;
         }