summaryrefslogtreecommitdiff
path: root/src/xsane-scan.c
diff options
context:
space:
mode:
authorJulien BLACHE <jblache@debian.org>2007-03-07 13:12:27 +0100
committerMattia Rizzolo <mattia@mapreri.org>2014-10-03 14:05:38 +0000
commit0db1f3318701235603f80455d7d1e5c1709e5eb1 (patch)
treeb79a911a1d9c8eb41ac88fa28a6a452fbca2eeb0 /src/xsane-scan.c
parent4d8384e7b116e3eb11cc3df9151c8554dbca95fc (diff)
parent1083fdcdb608210a42e00fc6819a6d5ce5996b2a (diff)
Imported Debian patch 0.994-1debian/0.994-1
Diffstat (limited to 'src/xsane-scan.c')
-rw-r--r--src/xsane-scan.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/src/xsane-scan.c b/src/xsane-scan.c
index 9cc9ffb..11aff3e 100644
--- a/src/xsane-scan.c
+++ b/src/xsane-scan.c
@@ -1090,7 +1090,23 @@ void xsane_scan_done(SANE_Status status)
image_info.cms_intent = preferences.cms_intent;
image_info.cms_bpc = preferences.cms_bpc;
- strncpy(image_info.icm_profile, xsane.scanner_default_color_icm_profile, sizeof(image_info.icm_profile));
+ image_info.icm_profile[0] = 0; /* empty string */
+
+ if (image_info.channels == 1)
+ {
+ if (xsane.scanner_default_gray_icm_profile)
+ {
+ strncpy(image_info.icm_profile, xsane.scanner_default_gray_icm_profile, sizeof(image_info.icm_profile));
+ }
+ }
+ else
+ {
+ if (xsane.scanner_default_color_icm_profile)
+ {
+ strncpy(image_info.icm_profile, xsane.scanner_default_color_icm_profile, sizeof(image_info.icm_profile));
+ }
+ }
+
xsane_write_pnm_header(xsane.out, &image_info, 0);
}
@@ -1349,13 +1365,13 @@ void xsane_scan_done(SANE_Status status)
imagewidth, imageheight,
preferences.printer[preferences.printernr]->leftoffset * 72.0/MM_PER_INCH, /* paper_left_margin */
preferences.printer[preferences.printernr]->bottomoffset * 72.0/MM_PER_INCH, /* paper_bottom_margin */
- preferences.printer[preferences.printernr]->width * 72.0/MM_PER_INCH, /* usable paperwidth */
- preferences.printer[preferences.printernr]->height * 72.0/MM_PER_INCH, /* usable paperheight */
+ preferences.printer[preferences.printernr]->width * 72.0/MM_PER_INCH, /* usable paper_width */
+ preferences.printer[preferences.printernr]->height * 72.0/MM_PER_INCH, /* usable paper_height */
preferences.paper_orientation,
preferences.printer[preferences.printernr]->ps_flatedecoded, /* ps level 3 */
NULL /* hTransform */, xsane.enable_color_management,
preferences.printer[preferences.printernr]->embed_csa, xsane.scanner_default_color_icm_profile,
- preferences.printer[preferences.printernr]->embed_crd, preferences.printer[preferences.printernr]->icm_profile, preferences.printer[preferences.printernr]->blackpointcompensation,
+ preferences.printer[preferences.printernr]->embed_crd, preferences.printer[preferences.printernr]->icm_profile, preferences.printer[preferences.printernr]->cms_bpc,
0 /* intent */,
xsane.progress_bar,
&xsane.cancel_save);
@@ -1769,7 +1785,23 @@ static void xsane_start_scan(void)
image_info.cms_intent = preferences.cms_intent;
image_info.cms_bpc = preferences.cms_bpc;
- strncpy(image_info.icm_profile, xsane.scanner_default_color_icm_profile, sizeof(image_info.icm_profile));
+
+ image_info.icm_profile[0] = 0; /* empty string */
+
+ if (image_info.channels == 1)
+ {
+ if (xsane.scanner_default_gray_icm_profile)
+ {
+ strncpy(image_info.icm_profile, xsane.scanner_default_gray_icm_profile, sizeof(image_info.icm_profile));
+ }
+ }
+ else
+ {
+ if (xsane.scanner_default_color_icm_profile)
+ {
+ strncpy(image_info.icm_profile, xsane.scanner_default_color_icm_profile, sizeof(image_info.icm_profile));
+ }
+ }
xsane_write_pnm_header(xsane.out, &image_info, 0);