kopia lustrzana https://gitlab.com/sane-project/backends
Fix conflicts
rodzic
fa75c94b24
commit
4ed0b0fd59
|
@ -688,11 +688,6 @@ sane_open(SANE_String_Const name, SANE_Handle *h)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = escl_status(device);
|
|
||||||
if (status != SANE_STATUS_GOOD) {
|
|
||||||
escl_free_device(device);
|
|
||||||
return (status);
|
|
||||||
}
|
|
||||||
handler = (escl_sane_t *)calloc(1, sizeof(escl_sane_t));
|
handler = (escl_sane_t *)calloc(1, sizeof(escl_sane_t));
|
||||||
if (handler == NULL) {
|
if (handler == NULL) {
|
||||||
escl_free_device(device);
|
escl_free_device(device);
|
||||||
|
@ -704,7 +699,7 @@ sane_open(SANE_String_Const name, SANE_Handle *h)
|
||||||
escl_free_handler(handler);
|
escl_free_handler(handler);
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
status = init_options(device, handler);
|
status = init_options(NULL, handler);
|
||||||
if (status != SANE_STATUS_GOOD) {
|
if (status != SANE_STATUS_GOOD) {
|
||||||
escl_free_handler(handler);
|
escl_free_handler(handler);
|
||||||
return (status);
|
return (status);
|
||||||
|
@ -952,7 +947,7 @@ sane_start(SANE_Handle h)
|
||||||
DBG (10, "Default Color allocation failure.\n");
|
DBG (10, "Default Color allocation failure.\n");
|
||||||
return (SANE_STATUS_NO_MEM);
|
return (SANE_STATUS_NO_MEM);
|
||||||
}
|
}
|
||||||
handler->result = escl_newjob(handler->scanner, handler->name, &status);
|
handler->result = escl_newjob(handler->scanner, handler->device, &status);
|
||||||
if (status != SANE_STATUS_GOOD)
|
if (status != SANE_STATUS_GOOD)
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
@ -1076,7 +1071,7 @@ sane_read(SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *len)
|
||||||
free(handler->scanner->img_data);
|
free(handler->scanner->img_data);
|
||||||
handler->scanner->img_data = NULL;
|
handler->scanner->img_data = NULL;
|
||||||
if (handler->scanner->source != PLATEN) {
|
if (handler->scanner->source != PLATEN) {
|
||||||
SANE_Status st = escl_status(handler->name, handler->scanner->source);
|
SANE_Status st = escl_status(handler->device, handler->scanner->source);
|
||||||
DBG(10, "eSCL : command returned status %s\n", sane_strstatus(st));
|
DBG(10, "eSCL : command returned status %s\n", sane_strstatus(st));
|
||||||
SANE_Bool next_page =
|
SANE_Bool next_page =
|
||||||
(SANE_STATUS_GOOD == st ?
|
(SANE_STATUS_GOOD == st ?
|
||||||
|
|
|
@ -185,41 +185,50 @@ find_valor_of_array_variables(xmlNode *node, capabilities_t *scanner, int type)
|
||||||
if (strcmp(name, "ColorMode") == 0) {
|
if (strcmp(name, "ColorMode") == 0) {
|
||||||
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
|
const char *color = (SANE_String_Const)xmlNodeGetContent(node);
|
||||||
if (type == PLATEN || strcmp(color, "BlackAndWhite1"))
|
if (type == PLATEN || strcmp(color, "BlackAndWhite1"))
|
||||||
scanner->caps[type].ColorModes = char_to_array(scanner->caps[type].ColorModes, &scanner->caps[type].ColorModesSize, (SANE_String_Const)xmlNodeGetContent(node), 1);
|
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)
|
else if (strcmp(name, "ContentType") == 0)
|
||||||
scanner->caps[type].ContentTypes = char_to_array(scanner->caps[type].ContentTypes, &scanner->caps[type].ContentTypesSize, (SANE_String_Const)xmlNodeGetContent(node), 0);
|
scanner->caps[type].ContentTypes = char_to_array(
|
||||||
|
scanner->caps[type].ContentTypes,
|
||||||
|
&scanner->caps[type].ContentTypesSize,
|
||||||
|
(SANE_String_Const)xmlNodeGetContent(node), 0);
|
||||||
else if (strcmp(name, "DocumentFormat") == 0)
|
else if (strcmp(name, "DocumentFormat") == 0)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int _is_jpeg = 0, _is_png = 0, _is_tiff = 0, _is_pdf = 0;
|
int _is_jpeg = 0, _is_png = 0, _is_tiff = 0, _is_pdf = 0;
|
||||||
scanner->DocumentFormats = char_to_array(scanner->DocumentFormats, &scanner->DocumentFormatsSize, (SANE_String_Const)xmlNodeGetContent(node), 0);
|
scanner->caps[type].DocumentFormats = char_to_array(
|
||||||
for(; i < scanner->DocumentFormatsSize; i++)
|
scanner->caps[type].DocumentFormats,
|
||||||
|
&scanner->caps[type].DocumentFormatsSize,
|
||||||
|
(SANE_String_Const)xmlNodeGetContent(node), 0);
|
||||||
|
for(; i < scanner->caps[type].DocumentFormatsSize; i++)
|
||||||
{
|
{
|
||||||
if (!strcmp(scanner->DocumentFormats[i], "image/jpeg"))
|
if (!strcmp(scanner->caps[type].DocumentFormats[i], "image/jpeg"))
|
||||||
_is_jpeg = 1;
|
_is_jpeg = 1;
|
||||||
#if(defined HAVE_LIBPNG)
|
#if(defined HAVE_LIBPNG)
|
||||||
else if(!strcmp(scanner->DocumentFormats[i], "image/png"))
|
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/png"))
|
||||||
_is_png = 1;
|
_is_png = 1;
|
||||||
#endif
|
#endif
|
||||||
#if(defined HAVE_TIFFIO_H)
|
#if(defined HAVE_TIFFIO_H)
|
||||||
else if(!strcmp(scanner->DocumentFormats[i], "image/tiff"))
|
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "image/tiff"))
|
||||||
_is_tiff = 1;
|
_is_tiff = 1;
|
||||||
#endif
|
#endif
|
||||||
#if(defined HAVE_POPPLER_GLIB)
|
#if(defined HAVE_POPPLER_GLIB)
|
||||||
else if(!strcmp(scanner->DocumentFormats[i], "application/pdf"))
|
else if(!strcmp(scanner->caps[type].DocumentFormats[i], "application/pdf"))
|
||||||
_is_pdf = 1;
|
_is_pdf = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (_is_pdf)
|
if (_is_pdf)
|
||||||
scanner->default_format = strdup("application/pdf");
|
scanner->caps[type].default_format = strdup("application/pdf");
|
||||||
else if (_is_tiff)
|
else if (_is_tiff)
|
||||||
scanner->default_format = strdup("image/tiff");
|
scanner->caps[type].default_format = strdup("image/tiff");
|
||||||
else if (_is_png)
|
else if (_is_png)
|
||||||
scanner->default_format = strdup("image/png");
|
scanner->caps[type].default_format = strdup("image/png");
|
||||||
else if(_is_jpeg)
|
else if(_is_jpeg)
|
||||||
scanner->default_format = strdup("image/jpeg");
|
scanner->caps[type].default_format = strdup("image/jpeg");
|
||||||
fprintf(stderr, "Capability : [%s]\n", scanner->default_format);
|
fprintf(stderr, "Capability : [%s]\n", scanner->caps[type].default_format);
|
||||||
}
|
}
|
||||||
else if (strcmp(name, "DocumentFormatExt") == 0)
|
else if (strcmp(name, "DocumentFormatExt") == 0)
|
||||||
scanner->caps[type].format_ext = 1;
|
scanner->caps[type].format_ext = 1;
|
||||||
|
@ -427,7 +436,7 @@ escl_capabilities(const ESCL_Device *device, SANE_Status *status)
|
||||||
scanner->source = 0;
|
scanner->source = 0;
|
||||||
print_xml_c(node, scanner, -1);
|
print_xml_c(node, scanner, -1);
|
||||||
_reduce_color_modes(scanner);
|
_reduce_color_modes(scanner);
|
||||||
|
|
||||||
xmlFreeDoc(data);
|
xmlFreeDoc(data);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
xmlMemoryDump();
|
xmlMemoryDump();
|
||||||
|
|
Ładowanie…
Reference in New Issue