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:54:51 +0100
committerJörg Frings-Fürst <debian@jff.email>2024-03-03 09:54:51 +0100
commit44916ca6d75e0b5f258a098a50d659f31c6625fd (patch)
tree2e51a12ae43b3def9e55d3f2c9ca60d2032ad45c /backend/escl/escl_newjob.c
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
New upstream version 1.3.0upstream/1.3.0upstream
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),