Commits

Christian Tismer committed fa666d9

added comment about circular import problems. The current solution works but is not final.
To be changed (much) later

Comments (0)

Files changed (1)

tool/tiff_reader/implementation.py

 one (the second by default). No other changes are made to the tiff
 data. Fortunately Qt is reading the IFP data correctly.
 
+--------
+Status of this module:
+I wanted to derive a specialized class from TiffReaderPlugin,
+but could not solve circular import problems when deriving the class.
+This always was a problem with PIL, and by deriving a class I force
+the plugin to load too early, which gives a cycle.
+
+The current procedural approach works for now.
 """
 
 from StringIO import StringIO as sio
 # it is a problem to derive a class here. Why?
 
 def read_tiff_page(filename, file_or_buffer=None, pageno=1):
+    """
+    Read a file or buffer and create a new tiff buffer positioned
+    to the page wanted.
+    
+    Returns a tuple (filename, buffer)
+    
+    On Error, returns None
+    """
     f = file_or_buffer
     if f and not hasattr(f, 'seek'):
         f = sio(f)