From b17c13074c1fed76d90d329b4e923c95b772279b Mon Sep 17 00:00:00 2001 From: Matan Ziv-Av Date: Fri, 5 Aug 2022 14:38:40 +0300 Subject: [PATCH] Initialize sixel mode even when missing Raster attributes Ph and Pv Use default Ph=8, Pv=6. Without this, some sixel commands (ususally the color table initialization) are not processed. --- src/Vt102Emulation.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index b5e4f401..1b14d89e 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -2950,7 +2950,7 @@ bool Vt102Emulation::processSixel(uint cc) } addArgument(); - if (params.count == 4) { + if (params.count == 4 || params.count == 2) { // We just ignore the pixel aspect ratio, it's dumb // const int pixelWidth = params.value[0]; // const int pixelHeight = params.value[1]; @@ -2961,8 +2961,16 @@ bool Vt102Emulation::processSixel(uint cc) } else { m_aspect = qMakePair(params.value[0], params.value[1]); } - const int width = params.value[2]; - const int height = params.value[3]; + int width; + int height; + if (params.count == 4) { + width = params.value[2]; + height = params.value[3]; + } else { + // Default size + width = 8; + height = 6; + } SixelModeEnable(width, height); } resetTokenizer();