--- Imaging-1.1.6/PIL/Image.py.orig 2009-07-15 07:44:06.210499375 -0700 +++ Imaging-1.1.6/PIL/Image.py 2009-07-15 07:47:38.546498713 -0700 @@ -197,6 +197,7 @@ "1": ('|b1', None), "L": ('|u1', None), "I": ('%si4' % _ENDIAN, None), # FIXME: is this correct? + "I;16": ('%si2' % _ENDIAN, None), "F": ('%sf4' % _ENDIAN, None), # FIXME: is this correct? "P": ('|u1', None), "RGB": ('|u1', 3), --- Imaging-1.1.6/PIL/TiffImagePlugin.py.orig 2009-07-15 07:50:27.723535040 -0700 +++ Imaging-1.1.6/PIL/TiffImagePlugin.py 2009-07-15 07:50:40.490496978 -0700 @@ -577,10 +577,16 @@ xdpi = getscalar(X_RESOLUTION, (1, 1)) ydpi = getscalar(Y_RESOLUTION, (1, 1)) - if xdpi and ydpi and getscalar(RESOLUTION_UNIT, 1) == 1: + if xdpi and ydpi: xdpi = xdpi[0] / (xdpi[1] or 1) ydpi = ydpi[0] / (ydpi[1] or 1) - self.info["dpi"] = xdpi, ydpi + unit = getscalar(RESOLUTION_UNIT, 1) + if unit == 1: + self.info["aspect"] = xdpi, ydpi + elif unit == 2: + self.info["dpi"] = xdpi, ydpi + elif unit == 3: + self.info["dpi"] = (xdpi*.39370079, ydpi*.39370079) # build tile descriptors x = y = l = 0 @@ -718,7 +724,7 @@ dpi = im.encoderinfo.get("dpi") if dpi: - ifd[RESOLUTION_UNIT] = 1 + ifd[RESOLUTION_UNIT] = 2 ifd[X_RESOLUTION] = _cvt_res(dpi[0]) ifd[Y_RESOLUTION] = _cvt_res(dpi[1])