openslide/openslide — Issue #79: Opening non-pyramidal tiled TIFF is excruciatingly slow
Author: bgilbert
Created: 2011-11-27 23:55:36+00:00
State: open

quickhash-1 over TIFF files is defined to include all tiles in the lowest-resolution layer, so if a generic tiled TIFF is not pyramidal, we are computing the hash over all of the image data in the file. This can cause `openslide_open()` to take 60 seconds or more for large TIFFs.

Arguably, OpenSlide isn't meant for non-pyramidal images. However, a program doing generic format detection on a file (e.g. VIPS) doesn't know any better.

(In the VIPS case, it's actually even worse. The VIPS OpenSlide driver does not want to support `generic-tiff` images, since the VIPS TIFF driver can do it better. But it still has to call `openslide_open()` to check `openslide.vendor`, incurring the quickhash overhead even though we're not going to use OpenSlide for this file.)

Options:
1. Permit deferring quickhash calculation until the attribute is read. Probably not useful for the other vendors; on the CMU dataset quickhash calculation is always less than half the total `openslide_open()` time.
2. Refuse to open a generic-tiff that is not pyramidal. This presumes that pyramidal TIFFs will not have perversely large top layers.
3. Others?