Skip to content

Commit

Permalink
aperio: Properly map associated images in single-level slides
Browse files Browse the repository at this point in the history
On single-level Aperio slides, we were dropping the thumbnail and label
and mislabeling the macro image as the thumbnail.  After encountering
exactly one tiled directory, any stripped image would be interpreted as
the thumbnail.  Instead, interpret only the second TIFF directory as the
thumbnail.

Reported-and-debugged-by: Kent Johnson <kent3737@gmail.com>
  • Loading branch information
bgilbert committed Nov 7, 2012
1 parent 6e030e0 commit 837624d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/openslide-vendor-aperio.c
Expand Up @@ -350,18 +350,19 @@ bool _openslide_try_aperio(openslide_t *osr, TIFF *tiff,
TIFFSetDirectory(tiff, 0);
i = 0;
do {
tdir_t dir = TIFFCurrentDirectory(tiff);
if (TIFFIsTiled(tiff)) {
levels[i++] = TIFFCurrentDirectory(tiff);
//g_debug("tiled directory: %d", TIFFCurrentDirectory(tiff));
levels[i++] = dir;
//g_debug("tiled directory: %d", dir);
} else {
// associated image
const char *name = (i == 1) ? "thumbnail" : NULL;
const char *name = (dir == 1) ? "thumbnail" : NULL;
if (!add_associated_image(osr ? osr->associated_images : NULL,
name, tiff, err)) {
g_prefix_error(err, "Can't read associated image: ");
goto FAIL;
}
//g_debug("associated image: %d", TIFFCurrentDirectory(tiff));
//g_debug("associated image: %d", dir);
}

// check depth
Expand Down

0 comments on commit 837624d

Please sign in to comment.