kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'escl-fix-adf' into 'master'
Escl revert adf lineart See merge request sane-project/backends!883merge-requests/884/head
commit
7f33a49d23
|
@ -201,8 +201,10 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
|
|||
{
|
||||
const char *name = (const char *)node->name;
|
||||
if (strcmp(name, "ColorMode") == 0) {
|
||||
#ifndef HAVE_POPPLER_GLIB
|
||||
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
|
||||
#if HAVE_POPPLER_GLIB
|
||||
if (type == PLATEN || strcmp(color, "BlackAndWhite1"))
|
||||
#else
|
||||
if (strcmp(color, "BlackAndWhite1"))
|
||||
#endif
|
||||
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes, &scanner->caps[type].ColorModesSize, (SANE_String_Const)xmlNodeGetContent(node), 1);
|
||||
|
@ -232,15 +234,15 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
|
|||
scanner->caps[type].have_png = i;
|
||||
}
|
||||
#endif
|
||||
#if(defined HAVE_LIBTIFF)
|
||||
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
|
||||
#if(defined HAVE_TIFFIO_H)
|
||||
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
|
||||
{
|
||||
have_tiff = SANE_TRUE;
|
||||
scanner->caps[type].have_tiff = i;
|
||||
}
|
||||
#endif
|
||||
#if HAVE_POPPLER_GLIB
|
||||
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
|
||||
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
|
||||
{
|
||||
have_pdf = SANE_TRUE;
|
||||
scanner->caps[type].have_pdf = i;
|
||||
|
|
|
@ -168,21 +168,38 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
|||
int have_tiff = scanner->caps[scanner->source].have_tiff;
|
||||
int have_pdf = scanner->caps[scanner->source].have_pdf;
|
||||
|
||||
if (have_pdf != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||
if ((scanner->source == PLATEN && have_pdf == -1) ||
|
||||
(scanner->source > PLATEN)) {
|
||||
if (have_tiff != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
|
||||
}
|
||||
else if (have_png != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
|
||||
}
|
||||
else if (have_jpeg != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
|
||||
}
|
||||
}
|
||||
else if (have_tiff != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
|
||||
}
|
||||
else if (have_png != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
|
||||
}
|
||||
else if (have_jpeg != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
|
||||
else {
|
||||
if (have_pdf != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||
}
|
||||
else if (have_tiff != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_tiff]);
|
||||
}
|
||||
else if (have_png != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_png]);
|
||||
}
|
||||
else if (have_jpeg != -1) {
|
||||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_jpeg]);
|
||||
}
|
||||
}
|
||||
if (atof ((const char *)device->version) <= 2.0)
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue