Clone of http://www.remotesensing.org/libtiff (from 4.0.3)