Skip to content

Commit

Permalink
mirax: Round up tile counts on non-subtiled slides
Browse files Browse the repository at this point in the history
When computing tiles per side on a subtiled slide level, we divide by
at most image_divisions, which always divides evenly.  But when
processing a non-subtiled slide (no overlaps and no position map), we
divide by arbitrary powers of two and were forgetting to round up.  This
could produce collisions in the JPEG tiles table, causing tiles to be
rendered in the wrong places.

Fixes #119.
  • Loading branch information
bgilbert committed Jul 24, 2013
1 parent dc7db99 commit 911c9b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/openslide-vendor-mirax.c
Expand Up @@ -648,7 +648,7 @@ static bool process_hier_data_pages_from_indexfile(FILE *f,
l->tile_advance_x, l->tile_advance_y,
x / lp->tile_count_divisor + xi,
y / lp->tile_count_divisor + yi,
tiles_across / lp->tile_count_divisor,
l->tiles_across,
zoom_level);
}
}
Expand Down Expand Up @@ -1652,8 +1652,8 @@ bool _openslide_try_mirax(openslide_t *osr, const char *filename,
l->tiles = _openslide_jpeg_create_tiles_table();
l->level_w = base_w / lp->tile_concat; // tile_concat is powers of 2
l->level_h = base_h / lp->tile_concat;
l->tiles_across = tiles_x / lp->tile_count_divisor;
l->tiles_down = tiles_y / lp->tile_count_divisor;
l->tiles_across = (tiles_x + lp->tile_count_divisor - 1) / lp->tile_count_divisor;
l->tiles_down = (tiles_y + lp->tile_count_divisor - 1) / lp->tile_count_divisor;
l->raw_tile_width = hs->tile_w; // raw JPEG size
l->raw_tile_height = hs->tile_h;

Expand Down

0 comments on commit 911c9b9

Please sign in to comment.