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:03 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:55:03 +0100
commit23c348d62ab9f0a902189c70921310a5f856852c (patch)
tree08c40dc8b180b31f504945e8da3e3ea3950e4145 /backend/escl/escl_newjob.c
parent2938695ca4c9bca7834817465662e31570f6d32f (diff)
parent44916ca6d75e0b5f258a098a50d659f31c6625fd (diff)
Update upstream source from tag 'upstream/1.3.0'
Update to upstream version '1.3.0' with Debian dir ab14a3d39c8a7f8e08536efd939bb78110db77f3
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),