Merge branch 'origin/pixma_bug_fixes' into 'master'

General pixma backend fixes

See merge request sane-project/backends!548
escl-fix-sleep-mode
Povilas Kanapickas 2020-12-07 13:21:30 +00:00
commit bb84652c3c
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -1455,8 +1455,8 @@ static void
pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data, pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
SANE_Int max_length, SANE_Int *length) SANE_Int max_length, SANE_Int *length)
{ {
struct jpeg_decompress_struct cinfo = ss->jpeg_cinfo; struct jpeg_decompress_struct *cinfo = &ss->jpeg_cinfo;
pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)ss->jpeg_cinfo.src; pixma_jpeg_src_mgr *src = (pixma_jpeg_src_mgr *)cinfo->src;
int l; int l;
@ -1476,7 +1476,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
return; return;
} }
if (cinfo.output_scanline >= cinfo.output_height) if (cinfo->output_scanline >= cinfo->output_height)
{ {
*length = 0; *length = 0;
return; return;
@ -1486,7 +1486,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
* only one line at time is supported * only one line at time is supported
*/ */
l = jpeg_read_scanlines(&cinfo, ss->jdst->buffer, 1); l = jpeg_read_scanlines(cinfo, ss->jdst->buffer, 1);
if (l == 0) if (l == 0)
return; return;
@ -1494,7 +1494,7 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
* linebuffer holds width * bytesperpixel * linebuffer holds width * bytesperpixel
*/ */
(*ss->jdst->put_pixel_rows)(&cinfo, ss->jdst, 1, (char *)src->linebuffer); (*ss->jdst->put_pixel_rows)(cinfo, ss->jdst, 1, (char *)src->linebuffer);
*length = ss->sp.w * ss->sp.channels; *length = ss->sp.w * ss->sp.channels;
/* Convert RGB into grayscale */ /* Convert RGB into grayscale */
@ -1527,10 +1527,10 @@ pixma_jpeg_read(pixma_sane_t *ss, SANE_Byte *data,
b = (b << 1) | 0; b = (b << 1) | 0;
else else
b = (b << 1) | 1; b = (b << 1) | 1;
}
if ((i % 8) == 0) if ((i % 8) == 0)
*(d++) = b; *(d++) = b;
} }
}
src->linebuffer_size = *length; src->linebuffer_size = *length;
src->linebuffer_index = 0; src->linebuffer_index = 0;