diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2024-06-30 15:46:39 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2024-06-30 15:46:39 +0200 |
commit | 73365252941d4053dca0e7fa06f4c205194cf1b8 (patch) | |
tree | 3eff4566f12e48cfee6b35955d262e46ee5a5da1 /backend/escl/escl_newjob.c | |
parent | 52c7d661296d9efb9a51b52c38dda22516cf981a (diff) | |
parent | 3c9b873509b5c2278d4e345bf86a22c1ff26f3c0 (diff) |
Merge branch 'release/debian/1.3.0-1'debian/1.3.0-1
Diffstat (limited to 'backend/escl/escl_newjob.c')
-rw-r--r-- | backend/escl/escl_newjob.c | 22 |
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), |