[Image-SIG] patch: TiffImagePlugin.py

Greg Couch gregc@cgl.ucsf.EDU
Mon, 18 Nov 2002 17:21:05 -0800 (PST)


Adobe Illustrator will not open a tiff file that is missing the compression
tag.  If tiff compression support is added (say when the lzw patent expires),
then this will have to be modified.  The fix is enclosed below.

	Greg Couch
	UCSF Computer Graphics Lab

*** TiffImagePlugin.py	2002/11/18 22:35:22	1.1
--- TiffImagePlugin.py	2002/11/19 00:50:03
***************
*** 656,661 ****
--- 656,662 ----
      ifd[ROWSPERSTRIP] = im.size[1]
      ifd[STRIPBYTECOUNTS] = stride * im.size[1]
      ifd[STRIPOFFSETS] = 0 # this is adjusted by IFD writer
+     ifd[COMPRESSION] = 1 # COMPRESSION_INFO[?] = "raw" (same as _save below)
  
      offset = ifd.save(fp)