pyexttiff — Classes to read Tiff
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 pyexttiff.PyexttiffError[source]
Bases: exceptions.Exception
Error handling for pyexttiff.
-
class pyexttiff.TiffFile(filename, subIFDpaths=[], method=1)[source]
Bases: object
This class allows the access to the entire tiff file (tags and images).
-
close()[source]
Closes the file.
-
get_PILImage()[source]
Returns the PIL image object of the file.
-
get_buffer()[source]
Returns the buffer
-
get_data()[source]
Returns the ndarray containing the data.
-
get_stringio()[source]
Returns the stringio representeing the buffer.
-
class pyexttiff.IFD[source]
Bases: list
This class represent an IFD.
-
as_dict()[source]
Returns a dictionary containing all entries.
-
get_entry(tag)[source]
Returns the entry for a tag
-
get_image()[source]
Returns the image
-
get_tags()[source]
Returns the list of the tags
-
get_value(tag, human=True)[source]
Returns the value for a tag
if human=True, value is modified:
- value[0] is retruned instead of value if array contains only one element
- conversion in string is achieved for arrays representing strings
-
has_image()[source]
Returns True if one tag is an image
-
has_tag(tag)[source]
Returns True if an entry fits the tag given
-
class pyexttiff.IFDEntry(tag, entrytype, value=None)[source]
Bases: object
This class represent an IFD entry
-
get_tag()[source]
Returns the tag
-
get_tagName()[source]
Returns the tag name
-
get_type()[source]
Returns the type of entry.
-
get_value(human=True)[source]
Returns the value
if human=True, value is modified:
- value[0] is retruned instead of value if array contains only one element
- conversion in string is achieved for arrays representing strings
-
is_IFD()[source]
Returns True if content is an IFD.
-
is_image()[source]
Returns True if content in an image
-
set_value(value)[source]
Sets the value of the entry.