From: Ilia Docin ilya.docin@contentai.ru
--- dlls/sane.ds/ds_image.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/sane.ds/ds_image.c b/dlls/sane.ds/ds_image.c index 2c52184a056..250b4aba6f9 100644 --- a/dlls/sane.ds/ds_image.c +++ b/dlls/sane.ds/ds_image.c @@ -335,10 +335,8 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin, switch (activeDS.frame_params.format) { case FMT_GRAY: - if (activeDS.frame_params.depth == 8) - color_size = (1 << 8) * sizeof(*colors); - else if (activeDS.frame_params.depth == 1) - ; + if (activeDS.frame_params.depth == 8 || activeDS.frame_params.depth == 1) + color_size = (1 << activeDS.frame_params.depth) * sizeof(*colors); else { FIXME("For NATIVE, we support only 1 bit monochrome and 8 bit Grayscale, not %d\n", activeDS.frame_params.depth); @@ -405,8 +403,15 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin, { colors = (RGBQUAD *) p; p += color_size; - for (i = 0; i < (color_size / sizeof(*colors)); i++) - colors[i].rgbBlue = colors[i].rgbRed = colors[i].rgbGreen = i; + if (activeDS.frame_params.depth == 1) + { + /* Sane uses 1 to represent minimum intensity (black) and 0 for maximum (white) */ + colors[0].rgbBlue = colors[0].rgbRed = colors[0].rgbGreen = 255; + colors[1].rgbBlue = colors[1].rgbRed = colors[1].rgbGreen = 0; + } + else + for (i = 0; i < (color_size / sizeof(*colors)); i++) + colors[i].rgbBlue = colors[i].rgbRed = colors[i].rgbGreen = i; }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=136201
Your paranoid android.
=== debian11b (64 bit WoW report) ===
ntdll: exception.c:3256: Test failed: B0 flag is not set in Dr6 exception.c:3257: Test failed: BS flag is set in Dr6
This merge request was approved by Esme Povirk.