help: Do not try to load PNG images

While reading the documentation, we should only load BMP files.
Only test for lowercase `bmp` extension, in case we want to be able to
easily skip particular BMP images (e.g. because they are too big).

Fixes: #1036

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2024-07-22 19:14:55 +02:00
parent c18a9975aa
commit 1c1f0b8235

View file

@ -3065,7 +3065,15 @@ bool user_interface::draw_help()
else
isimg = false;
}
isimg = (c == ')');
isimg = c == ')';
if (isimg)
{
byte *ext = scr.scratch() + scr.growth() - 4;
isimg =
ext[0] == 'b' &&
ext[1] == 'm' &&
ext[2] == 'p';
}
if (isimg)
{
name = text::make(scr.scratch(), scr.growth()-1);
@ -3088,9 +3096,9 @@ bool user_interface::draw_help()
}
imdsp = true;
emit = true;
skip = true;
}
}
skip = true;
break;
case '<':