The test case was ignoring the documented API for TIFFReadRGBATile, namely that the output pixels are uint32's and the macros TIFFGetR etc should be used to fetch the pixel components. Original patch by Marcus Meissner, somewhat cleaned up by me.