<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -452,8 +452,9 @@ module EXIFR
 
       def initialize(data, pos)
         @tag, count, @offset = data.readshort(pos), data.readlong(pos + 4), data.readlong(pos + 8)
+        @type = data.readshort(pos + 2)
 
-        case data.readshort(pos + 2)
+        case @type
         when 1, 6 # byte, signed byte
           # TODO handle signed bytes
           len, pack = count, proc { |d| d }
@@ -465,6 +466,14 @@ module EXIFR
         when 4, 9 # long, signed long
           # TODO handle signed
           len, pack = count * 4, proc { |d| d.unpack(data.long + '*') }
+        when 7 # undefined
+          # UserComment 
+          if @tag == 0x9286
+            len, pack = count, proc { |d| d.strip }
+            len -= 8 # reduce to account for first 8 bytes
+            start = len &gt; 4 ? @offset + 8 : (pos + 8) # UserComment first 8-bytes is char code
+            @value = [pack[data[start..(start + len - 1)]]].flatten
+          end
         when 5, 10
           len, pack = count * 8, proc do |d|
             r = []
@@ -481,7 +490,7 @@ module EXIFR
           end
         end
 
-        if len &amp;&amp; pack
+        if len &amp;&amp; pack &amp;&amp; @type != 7
           start = len &gt; 4 ? @offset : (pos + 8)
           @value = [pack[data[start..(start + len - 1)]]].flatten
         end</diff>
      <filename>lib/tiff.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9b9dd47839d631db9ea8b530e19f3ae65bb1acc4</id>
    </parent>
  </parents>
  <author>
    <name>Mark Lundquist</name>
    <email>mlundquist@xenon.hrn.amberjack.net</email>
  </author>
  <url>http://github.com/remvee/exifr/commit/41c3366571640f751ba0d91d32ffc4bd63917794</url>
  <id>41c3366571640f751ba0d91d32ffc4bd63917794</id>
  <committed-date>2009-08-30T14:01:40-07:00</committed-date>
  <authored-date>2009-08-30T14:01:40-07:00</authored-date>
  <message>Added handling of UserComment (type Undefined) to extract data.  This fixes the
bug with user_comment returning nil.</message>
  <tree>ea628e2446cdbd623ef8037fa4495c2d2bf55e79</tree>
  <committer>
    <name>Mark Lundquist</name>
    <email>mlundquist@xenon.hrn.amberjack.net</email>
  </committer>
</commit>
