better rounding in tile calcs

This commit is contained in:
John Cupitt 2021-03-20 12:54:32 +00:00
parent 7a900e0a4e
commit 76b7cddba1

View File

@ -592,8 +592,10 @@ vips_foreign_load_jp2k_generate( VipsRegion *out,
/* jp2k get smaller with the layer size.
*/
int tile_width = jp2k->info->tdx / jp2k->shrink;
int tile_height = jp2k->info->tdy / jp2k->shrink;
int tile_width = VIPS_ROUND_UINT(
(double) jp2k->info->tdx / jp2k->shrink );
int tile_height = VIPS_ROUND_UINT(
(double) jp2k->info->tdy / jp2k->shrink );
/* ... so tiles_across is always the same.
*/