summaryrefslogtreecommitdiff
path: root/backend/escl/escl_newjob.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-03-03 09:55:14 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:55:14 +0100
commitb098beb219b0b300ec7eb915bfa2b3038c3fb533 (patch)
tree08c40dc8b180b31f504945e8da3e3ea3950e4145 /backend/escl/escl_newjob.c
parent2938695ca4c9bca7834817465662e31570f6d32f (diff)
parent23c348d62ab9f0a902189c70921310a5f856852c (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/escl/escl_newjob.c')
-rw-r--r--backend/escl/escl_newjob.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/backend/escl/escl_newjob.c b/backend/escl/escl_newjob.c
index e1b326f..cb48bd1 100644
--- a/backend/escl/escl_newjob.c
+++ b/backend/escl/escl_newjob.c
@@ -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>" \
@@ -184,10 +184,24 @@ escl_newjob (capabilities_t *scanner, const ESCL_Device *device, SANE_Status *st
}
}
else {
- scanner->caps[scanner->source].default_format =
- strdup(scanner->caps[scanner->source].DocumentFormats[have_pdf]);
+ 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 (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),