From 36b19c5dd8fb68318f481cff4e9a6ee41e2e7f10 Mon Sep 17 00:00:00 2001 From: Jonas Teuwen Date: Mon, 24 Apr 2023 18:17:36 +0200 Subject: [PATCH] Fix height/width computation --- src/isyntax/isyntax.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/isyntax/isyntax.c b/src/isyntax/isyntax.c index 765b81b..634c2d5 100644 --- a/src/isyntax/isyntax.c +++ b/src/isyntax/isyntax.c @@ -407,6 +407,9 @@ static bool isyntax_parse_scannedimage_child_node(isyntax_t* isyntax, u32 group, case 3: { image->level_count = range.numsteps; image->max_scale = range.numsteps - 1; + int32_t level_padding = (PER_LEVEL_PADDING << range.numsteps) - PER_LEVEL_PADDING; + image->width -= 2 * level_padding; + image->height -= 2 * level_padding; } break; case 4: break; // always 4 wavelet coefficients ("LL" "LH" "HL" "HH"), no need to check }