modified tiff.py file