kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'escl-fix-pwg-version' into 'master'
escl: Fix version of pwf:Version Closes #675 See merge request sane-project/backends!788707-xerox_mfp-scx-4521-fixes-are-not-merged
commit
b171aa7d87
|
@ -92,7 +92,7 @@ typedef struct {
|
|||
typedef struct ESCL_Device {
|
||||
struct ESCL_Device *next;
|
||||
|
||||
double version;
|
||||
char *version;
|
||||
char *model_name;
|
||||
int port_nb;
|
||||
char *ip_address;
|
||||
|
|
|
@ -432,7 +432,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 +588,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++)
|
||||
|
|
|
@ -46,7 +46,7 @@ struct downloading
|
|||
static const char settings[] =
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
|
||||
"<scan:ScanSettings xmlns:pwg=\"http://www.pwg.org/schemas/2010/12/sm\" xmlns:scan=\"http://schemas.hp.com/imaging/escl/2011/05/03\">" \
|
||||
" <pwg:Version>%.2f</pwg:Version>" \
|
||||
" <pwg:Version>%s</pwg:Version>" \
|
||||
" <pwg:ScanRegions>" \
|
||||
" <pwg:ScanRegion>" \
|
||||
" <pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>" \
|
||||
|
@ -187,7 +187,7 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
|
|||
scanner->caps[scanner->source].default_format =
|
||||
strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
|
||||
}
|
||||
if (device->version <= 2.0)
|
||||
if (atof ((const char *)device->version) <= 2.0)
|
||||
{
|
||||
// For eSCL 2.0 and older clients
|
||||
snprintf(f_ext_tmp, sizeof(f_ext_tmp),
|
||||
|
|
Ładowanie…
Reference in New Issue