Subject: Re: bug#36337: 26.1; XBM images are sometimes not displayed correctly

From: Pip Cet <[email-masked]>
Date: Sun, 23 Jun 2019 16:26:16 +0000

On Sun, Jun 23, 2019 at 2:29 PM Eli Zaretskii <[email-masked]> wrote:
> > From: Pip Cet <[email-masked]>
> > Date: Sun, 23 Jun 2019 08:05:55 +0000
> > Cc: [email-masked]
> > This is easy enough to fix by rewriting the bool vector, but that's
> > potentially very slow (on debug builds), so maybe we shouldn't do
> > that?
> >
> > Does the attached patch work for you?
>
> Thanks, but I really hope there's a more elegant solution.

I thought there had to be, but I've yet to think of anything that's
unequivocally better.

My suggestion would be to expand `substring' to work on bool vectors,
then building a vector of bool vectors and using the existing code for
that case. Less code in image.c, plus a new utility function that
might be generally useful. (However, do we want to encourage people to
use bool vectors?)

I don't think performance is an issue, though, and you might disagree.

> If not,
> maybe we should simply require that both width and height be an
> integral multiple of 8 in this case.

Why would you require the height to be a multiple of 8?