From afa66200a00429c626ee2440bc13f40a87044824 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Fri, 28 Oct 2022 17:58:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=86=85=E5=AD=98=E4=BC=A0?= =?UTF-8?q?=E8=BE=93=E9=BB=91=E7=99=BD=E5=9B=BE=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twain/twain/huagaods.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 7f7962c..133a280 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -1000,7 +1000,12 @@ Result huagao_ds::imageInfoGet(const Identity&, ImageInfo& data) if (m_compression == Compression::Group4) data.setPixelType(PixelType::BlackWhite); else - data.setPixelType(head.format == SANE_FRAME_RGB ? PixelType::Rgb : PixelType::Gray); + { + if (head.format == SANE_FRAME_RGB) + data.setPixelType(PixelType::Rgb); + else if(head.format == SANE_FRAME_GRAY) + data.setPixelType(head.depth == 1 ? PixelType::BlackWhite : PixelType::Gray); + } data.setPlanar(false); data.setWidth(head.pixels_per_line);