From 5c73d3878d4904bce3d61399fb6a222ed39a4dbc Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 7 Dec 2025 22:11:45 +0000 Subject: [PATCH 1/3] FIx combine test again... --- regress/combine-test.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regress/combine-test.result b/regress/combine-test.result index a08539fb..0d2afb5e 100644 --- a/regress/combine-test.result +++ b/regress/combine-test.result @@ -4,7 +4,7 @@ Λ̊1 🏻2 👍🏻3 -👍🏻 👍🏻4 +👍🏻 👍🏻4 🤷‍♂️5 ♂️7 🤷‍♂️8 From 2e5e9c02982776a35a0378206966991e5dd4c723 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 8 Dec 2025 21:41:30 +0000 Subject: [PATCH 2/3] Fix calculation of scaled SIXEL size, from nincsnevem662 at gmail dot com in GitHub issue 4739. --- image-sixel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/image-sixel.c b/image-sixel.c index 1c93d7a7..5c800461 100644 --- a/image-sixel.c +++ b/image-sixel.c @@ -455,12 +455,12 @@ sixel_scale(struct sixel_image *si, u_int xpixel, u_int ypixel, u_int ox, new->p2 = si->p2; new->set_ra = si->set_ra; - /* clamp to slice end */ - new->ra_x = si->ra_x < psx ? si->ra_x : psx; - new->ra_y = si->ra_y < psy ? si->ra_y : psy; - /* subtract slice origin */ + /* subtract offset */ new->ra_x = new->ra_x > pox ? new->ra_x - pox : 0; new->ra_y = new->ra_y > poy ? new->ra_y - poy : 0; + /* clamp to size */ + new->ra_x = si->ra_x < psx ? si->ra_x : psx; + new->ra_y = si->ra_y < psy ? si->ra_y : psy; /* resize */ new->ra_x = new->ra_x * xpixel / si->xpixel; new->ra_y = new->ra_y * ypixel / si->ypixel; From 4b810ae4932367afc8509bc8105603a8d965b0b8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 9 Dec 2025 08:46:00 +0000 Subject: [PATCH 3/3] Add a define for max images and bump to 20 for the moment. --- image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/image.c b/image.c index 43808785..6e2b1701 100644 --- a/image.c +++ b/image.c @@ -25,6 +25,7 @@ static struct images all_images = TAILQ_HEAD_INITIALIZER(all_images); static u_int all_images_count; +#define MAX_IMAGE_COUNT 20 static void image_free(struct image *im) @@ -111,7 +112,7 @@ image_store(struct screen *s, struct sixel_image *si) TAILQ_INSERT_TAIL(&s->images, im, entry); TAILQ_INSERT_TAIL(&all_images, im, all_entry); - if (++all_images_count == 10/*XXX*/) + if (++all_images_count == MAX_IMAGE_COUNT) image_free(TAILQ_FIRST(&all_images)); return (im);