summaryrefslogtreecommitdiff
path: root/backend/escl/escl_capabilities.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
commit44916ca6d75e0b5f258a098a50d659f31c6625fd (patch)
tree2e51a12ae43b3def9e55d3f2c9ca60d2032ad45c /backend/escl/escl_capabilities.c
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
New upstream version 1.3.0upstream/1.3.0
Diffstat (limited to 'backend/escl/escl_capabilities.c')
-rw-r--r--backend/escl/escl_capabilities.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/backend/escl/escl_capabilities.c b/backend/escl/escl_capabilities.c
index efbd547..950efaa 100644
--- a/backend/escl/escl_capabilities.c
+++ b/backend/escl/escl_capabilities.c
@@ -72,7 +72,7 @@ convert_elements(SANE_String_Const str)
return (SANE_VALUE_SCAN_MODE_GRAY);
else if (strcmp(str, "RGB24") == 0)
return (SANE_VALUE_SCAN_MODE_COLOR);
-#if(defined HAVE_POPPLER_GLIB)
+#if HAVE_POPPLER_GLIB
else if (strcmp(str, "BlackAndWhite1") == 0)
return (SANE_VALUE_SCAN_MODE_LINEART);
#endif
@@ -202,7 +202,11 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
const char *name = (const char *)node->name;
if (strcmp(name, "ColorMode") == 0) {
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);
}
else if (strcmp(name, "ContentType") == 0)
@@ -237,7 +241,7 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
scanner->caps[type].have_tiff = i;
}
#endif
-#if(defined HAVE_POPPLER_GLIB)
+#if HAVE_POPPLER_GLIB
else if(type == PLATEN && !strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
{
have_pdf = SANE_TRUE;
@@ -432,7 +436,7 @@ print_xml_c(xmlNode *node, ESCL_Device *device, capabilities_t *scanner, int typ
}
if (!strcmp((const char *)node->name, "Version")&& node->ns && node->ns->prefix){
if (!strcmp((const char*)node->ns->prefix, "pwg"))
- device->version = atof ((const char *)xmlNodeGetContent(node));
+ device->version = strdup((const char *)xmlNodeGetContent(node));
}
if (!strcmp((const char *)node->name, "MakeAndModel")){
device->model_name = strdup((const char *)xmlNodeGetContent(node));
@@ -588,7 +592,6 @@ escl_capabilities(ESCL_Device *device, char *blacklist, SANE_Status *status)
strstr(header->memory, "Server: HP_Compact_Server"))
device->hack = curl_slist_append(NULL, "Host: localhost");
- device->version = 0.0;
scanner->source = 0;
scanner->Sources = (SANE_String_Const *)malloc(sizeof(SANE_String_Const) * 4);
for (i = 0; i < 4; i++)