From 87193ff339df0e9808ef438239bfa84b4dcf1b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 22 Feb 2020 10:49:00 +0100 Subject: [PATCH] sixel: raster: only resize image buffer if necessary --- sixel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sixel.c b/sixel.c index b3bbdb65..cfef67f3 100644 --- a/sixel.c +++ b/sixel.c @@ -260,7 +260,9 @@ sixel_raster(struct terminal *term, uint8_t c) LOG_DBG("pan=%u, pad=%u (aspect ratio = %u), size=%ux%u", pan, pad, pan / pad, ph, pv); - resize(term, ph, pv); + + if (ph >= term->sixel.image.height && pv >= term->sixel.image.width) + resize(term, ph, pv); } switch (c) {