bronx.datagrip.pyexttiff¶
This module aims at reading tiff with private IFDs. It uses PIL for image reading.
This module uses code from pylibtiff (https://pypi.python.org/pypi/libtiff, https://code.google.com/p/pylibtiff or https://github.com/hmeine/pylibtiff)
Classes¶
- class bronx.datagrip.pyexttiff.IFD[source]¶
Bases:
listThis class represent an IFD.
Initialisation method of IFD class.
- class bronx.datagrip.pyexttiff.IFDEntry(tag, entrytype, value=None)[source]¶
Bases:
objectThis class represent an IFD entry.
tag is the tag number of the entry
entrytype is the type of the entry
value is the value associated to the tag
- class bronx.datagrip.pyexttiff.TiffFile(filename, subIFDpaths=[], method=1)[source]¶
Bases:
objectThis class allows the access to the entire tiff file (tags and images).
Opens a tiff file, reads header and IFDs.
filename is the filename containing the tiff
- subIFDpaths is the list of tag path whose values are offset to private IFDs
a tag path is a tuple representing the path to a given tag which must represent an IFD
means that tag 34665 of any given public IFD is an offset to a private IFD
(32001, 521) means that tag 32001 of any given public IFD is an offset to a private IFD and that tag 521 of any private tag referenced by a 32001 public tag is also an offset to a private IFD
method is the method used to read data:
1: f=io.open(…, ‘rb’) ; numpy.frombuffer(f.read(), dtype=numpy.ubyte)
2: f=io.open(…, ‘rb’) ; numpy.ndarray(buffer=mmap(f), dtype=numpy.ubyte)
3: same as 2 but with modifications allowed - DANGEROUS