summaryrefslogtreecommitdiff
path: root/src/cups
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2017-10-25 12:30:55 +0200
committerDidier Raboud <odyx@debian.org>2017-10-25 12:30:55 +0200
commit9dd97a029bf391c42b1dc76f2f7c5e386bb8f466 (patch)
treeec2b3262b629dd03af9924906ec3bdbd6c54ef83 /src/cups
parent337ffefc0bdf252749c81ebb9255556d54c3e632 (diff)
New upstream version 5.3.0~pre1
Diffstat (limited to 'src/cups')
-rw-r--r--src/cups/Makefile.am29
-rw-r--r--src/cups/Makefile.in29
-rw-r--r--src/cups/backend_canonselphy.c4
-rw-r--r--src/cups/backend_dnpds40.c8
-rw-r--r--src/cups/backend_mitsu70x.c78
-rw-r--r--src/cups/backend_sonyupdr150.c5
-rw-r--r--src/cups/blacklist4
-rw-r--r--src/cups/genppd.c74
-rw-r--r--src/cups/rastertoprinter.c152
-rwxr-xr-xsrc/cups/test-rastertogutenprint.in5
10 files changed, 253 insertions, 135 deletions
diff --git a/src/cups/Makefile.am b/src/cups/Makefile.am
index 62ce028..4ef097d 100644
--- a/src/cups/Makefile.am
+++ b/src/cups/Makefile.am
@@ -248,6 +248,11 @@ ppd-nonls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
$(MAKE) ppd-catalog-clean
LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ @WHICH_PPDS@ $(EXTRA_GENPPD_OPTS) -l C -p ppd/C
+ppd-nonls-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ $(mkdir_p) ppd/C
+ $(MAKE) ppd-catalog-clean
+ LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ @WHICH_PPDS@ $(EXTRA_GENPPD_OPTS) -l C -p ppd/C -a
+
ppd-global: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
@echo "Global PPDs:"
$(mkdir_p) ppd/Global
@@ -255,6 +260,13 @@ ppd-global: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global
$(MAKE) ppd-catalog-clean
+ppd-global-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ @echo "Global PPDs:"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
+ LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -a
+ $(MAKE) ppd-catalog-clean
+
ppd-global-ln: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
@echo "Global PPDs (localized numbers for testing):"
$(mkdir_p) ppd/Global
@@ -262,6 +274,13 @@ ppd-global-ln: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -N
$(MAKE) ppd-catalog-clean
+ppd-global-ln-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ @echo "Global PPDs (localized numbers for testing):"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
+ LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -N -a
+ $(MAKE) ppd-catalog-clean
+
ppd-nls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
$(mkdir_p) ppd
$(MAKE) ppd-catalog
@@ -272,6 +291,16 @@ ppd-nls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
done
$(MAKE) ppd-catalog-clean
+ppd-nls-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
+ $(mkdir_p) ppd
+ $(MAKE) ppd-catalog
+ for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ -L` ; do \
+ $(mkdir_p) ppd/$$language ; \
+ echo -n "$$language: " ; \
+ LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -l $$language -p ppd/$$language -a; \
+ done
+ $(MAKE) ppd-catalog-clean
+
dist-hook:
for dir in commands ; do \
if test -d $(srcdir)/$$dir ; then \
diff --git a/src/cups/Makefile.in b/src/cups/Makefile.in
index 27bcc47..04419cb 100644
--- a/src/cups/Makefile.in
+++ b/src/cups/Makefile.in
@@ -2019,6 +2019,11 @@ ppd-nonls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
$(MAKE) ppd-catalog-clean
LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ @WHICH_PPDS@ $(EXTRA_GENPPD_OPTS) -l C -p ppd/C
+ppd-nonls-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ $(mkdir_p) ppd/C
+ $(MAKE) ppd-catalog-clean
+ LC_ALL= LANG= LANGUAGE= $(STP_NONLS_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ @WHICH_PPDS@ $(EXTRA_GENPPD_OPTS) -l C -p ppd/C -a
+
ppd-global: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
@echo "Global PPDs:"
$(mkdir_p) ppd/Global
@@ -2026,6 +2031,13 @@ ppd-global: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global
$(MAKE) ppd-catalog-clean
+ppd-global-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ @echo "Global PPDs:"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
+ LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -a
+ $(MAKE) ppd-catalog-clean
+
ppd-global-ln: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
@echo "Global PPDs (localized numbers for testing):"
$(mkdir_p) ppd/Global
@@ -2033,6 +2045,13 @@ ppd-global-ln: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -N
$(MAKE) ppd-catalog-clean
+ppd-global-ln-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@
+ @echo "Global PPDs (localized numbers for testing):"
+ $(mkdir_p) ppd/Global
+ $(MAKE) ppd-catalog
+ LC_ALL= LANG= LANGUAGE= $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -p ppd/Global -N -a
+ $(MAKE) ppd-catalog-clean
+
ppd-nls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
$(mkdir_p) ppd
$(MAKE) ppd-catalog
@@ -2043,6 +2062,16 @@ ppd-nls: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
done
$(MAKE) ppd-catalog-clean
+ppd-nls-a: cups-genppd.@GUTENPRINT_RELEASE_VERSION@ ppd-nonls
+ $(mkdir_p) ppd
+ $(MAKE) ppd-catalog
+ for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ -L` ; do \
+ $(mkdir_p) ppd/$$language ; \
+ echo -n "$$language: " ; \
+ LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_RELEASE_VERSION@ $(EXTRA_GENPPD_OPTS) @WHICH_PPDS@ -l $$language -p ppd/$$language -a; \
+ done
+ $(MAKE) ppd-catalog-clean
+
dist-hook:
for dir in commands ; do \
if test -d $(srcdir)/$$dir ; then \
diff --git a/src/cups/backend_canonselphy.c b/src/cups/backend_canonselphy.c
index 1fdd3a5..8b016df 100644
--- a/src/cups/backend_canonselphy.c
+++ b/src/cups/backend_canonselphy.c
@@ -978,7 +978,7 @@ top:
if (ctx->cp900)
state = S_PRINTER_CP900_FOOTER;
else
- state = S_FINISHED;
+ state = S_PRINTER_DONE;
}
break;
case S_PRINTER_CP900_FOOTER: {
@@ -1051,7 +1051,7 @@ static void canonselphy_cmdline(void)
struct dyesub_backend canonselphy_backend = {
.name = "Canon SELPHY CP/ES",
- .version = "0.93",
+ .version = "0.94",
.uri_prefix = "canonselphy",
.cmdline_usage = canonselphy_cmdline,
.cmdline_arg = canonselphy_cmdline_arg,
diff --git a/src/cups/backend_dnpds40.c b/src/cups/backend_dnpds40.c
index 43fac69..0484eb9 100644
--- a/src/cups/backend_dnpds40.c
+++ b/src/cups/backend_dnpds40.c
@@ -1,7 +1,7 @@
/*
* DNP DS40/DS80 Photo Printer CUPS backend -- libusb-1.0 version
*
- * (c) 2013-2016 Solomon Peachy <pizza@shaftnet.org>
+ * (c) 2013-2017 Solomon Peachy <pizza@shaftnet.org>
*
* Development of this backend was sponsored by:
*
@@ -698,9 +698,11 @@ static void dnpds40_attach(void *vctx, struct libusb_device_handle *dev,
if (FW_VER_CHECK(1,20))
ctx->supports_adv_fullcut = ctx->supports_advmatte = 1;
if (FW_VER_CHECK(1,30))
- ctx->supports_luster = ctx->supports_finematte = 1;
+ ctx->supports_luster = 1;
if (FW_VER_CHECK(1,33))
ctx->supports_media_ext = 1;
+ if (FW_VER_CHECK(1,52))
+ ctx->supports_finematte = 1;
break;
case P_DNP_DS820:
ctx->native_width = 2560;
@@ -2484,7 +2486,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend dnpds40_backend = {
.name = "DNP DS40/DS80/DSRX1/DS620",
- .version = "0.91",
+ .version = "0.92",
.uri_prefix = "dnpds40",
.cmdline_usage = dnpds40_cmdline,
.cmdline_arg = dnpds40_cmdline_arg,
diff --git a/src/cups/backend_mitsu70x.c b/src/cups/backend_mitsu70x.c
index 60d99dd..00547a0 100644
--- a/src/cups/backend_mitsu70x.c
+++ b/src/cups/backend_mitsu70x.c
@@ -115,8 +115,8 @@ typedef int (*send_image_dataFN)(struct BandImage *out, void *context,
#define USB_PID_MITSU_D90 0x3B60
#define USB_VID_KODAK 0x040a
#define USB_PID_KODAK305 0x404f
-//#define USB_VID_FUJIFILM XXXXXX
-//#define USB_PID_FUJI_ASK300 XXXXXX
+#define USB_VID_FUJIFILM 0x04cb
+#define USB_PID_FUJI_ASK300 0x5006
/* Width of the laminate data file */
#define LAMINATE_STRIDE 1864
@@ -304,7 +304,7 @@ struct mitsu70x_jobs {
struct mitsu70x_status_deck {
uint8_t mecha_status[2];
- uint8_t temperature; /* D70 family only, K60 no */
+ uint8_t temperature; /* D70/D80 family only, K60 no? */
uint8_t error_status[3];
uint8_t rsvd_a[10]; /* K60 family [1] == temperature? [3:6] == lifetime prints in BCD */
@@ -328,20 +328,23 @@ struct mitsu70x_printerstatus_resp {
uint8_t memory;
uint8_t power;
uint8_t unk[20];
- uint8_t sleeptime; /* In minutes, 0-10 */
+ uint8_t sleeptime; /* In minutes, 0-60 */
uint8_t iserial; /* 0x00 for Enabled, 0x80 for Disabled */
uint8_t unk_b[12];
int16_t model[6]; /* LE, UTF-16 */
int16_t serno[6]; /* LE, UTF-16 */
struct mitsu70x_status_ver vers[7]; // components are 'MLRTF'
uint8_t null[2];
- uint8_t user_serno[6]; /* Supposedly, don't know how to set it */
+ uint8_t user_serno[6]; /* XXX Supposedly, don't know how to set it */
struct mitsu70x_status_deck lower;
struct mitsu70x_status_deck upper;
} __attribute__((packed));
+#define MK60S_0105_M_CSUM 0x148C /* 1.05 316M3 1 148C */
#define EK305_0104_M_CSUM 0x2878 /* 1.04 316F8 3 2878 */
+#define MD70X_0110_M_CSUM 0x064D /* 1.10 316V1 1 064D */
#define MD70X_0112_M_CSUM 0x9FC3 /* 1.12 316W1 1 9FC3 */
+#define FA300_XXXX_M_CSUM 0x4431 /* ?.?? 416J2 1 4431 */
struct mitsu70x_memorystatus_resp {
uint8_t hdr[3]; /* E4 56 33 */
@@ -355,7 +358,7 @@ struct mitsu70x_memorystatus_resp {
struct mitsu70x_hdr {
uint8_t hdr[4]; /* 1b 5a 54 XX */ // XXX also, seen 1b 5a 43!
uint16_t jobid;
- uint8_t rewind[2]; /* XXX K60/EK305/D80 only, 0 normally, 1 for "skip" ??? */
+ uint8_t rewind[2]; /* K60/EK305/D80 only */
uint8_t zero0[8];
uint16_t cols;
@@ -365,14 +368,14 @@ struct mitsu70x_hdr {
uint8_t speed;
uint8_t zero1[7];
- uint8_t deck; /* 0 = default, 1 = lower, 2 = upper */
+ uint8_t deck; /* 0 = default, 1 = lower, 2 = upper -- Non-D70/D707 is always '1' */
uint8_t zero2[7];
uint8_t laminate; /* 00 == on, 01 == off */
uint8_t laminate_mode; /* 00 == glossy, 02 == matte */
uint8_t zero3[6];
uint8_t multicut;
- uint8_t zero4[12];
+ uint8_t zero4[12]; /* NOTE: everything past this point is an extension */
uint8_t sharpen; /* 0-9. 5 is "normal", 0 is "off" */
uint8_t mode; /* 0 for cooked YMC planar, 1 for packed BGR */
uint8_t use_lut; /* in BGR mode, 0 disables, 1 enables */
@@ -444,6 +447,15 @@ static char *mitsu70x_jobstatuses(uint8_t *sts)
case JOB_STATUS1_END_OK:
return "Normal End";
case JOB_STATUS1_END_HEADER:
+ switch(sts[2]) {
+ case JOB_STATUS2_END_HEADER_ERROR:
+ return "Incorrect Header data (bad print size?)";
+ case JOB_STATUS2_END_HEADER_MEMORY:
+ return "Insufficient printer memory";
+ default:
+ return "Unknown 'End Header' status2";
+ }
+ break;
case JOB_STATUS1_END_PRINT:
switch(sts[2]) {
case JOB_STATUS2_END_PRINT_MEDIA:
@@ -619,7 +631,7 @@ static const char *mitsu70x_media_types(uint8_t brand, uint8_t type)
else if (brand == 0xff && type == 0x05)
return "CK-D769 (6x9)";
else if (brand == 0xff && type == 0x0f)
- return "CK-D768 (6x8)";
+ return "CK-D768/CK-D868 (6x8)";
else if (brand == 0x6c && type == 0x84)
return "Kodak 5R (5x7)";
else if (brand == 0x6c && type == 0x8f)
@@ -628,14 +640,21 @@ static const char *mitsu70x_media_types(uint8_t brand, uint8_t type)
return "CK-K57R (5x7)";
else if (brand == 0x61 && type == 0x8f)
return "CK-K76R (6x8)";
+ else if (brand == 0x7a && type == 0x01)
+ return "RL-CF900 (3.5x5)";
+ else if (brand == 0x7a && type == 0x02)
+ return "RK-CF800/4R (4x6)";
+ else if (brand == 0x7a && type == 0x04)
+ return "R2L-CF460/5R (5x7)";
+ else if (brand == 0x7a && type == 0x0f)
+ return "R68-CF400/6R (6x8)";
else
return "Unknown";
// Also CK-D715, CK-D718, CK-D720, CK-D723 (4x6,5x8,6x8,6x9) for D70-S model
// CK-D746-U for D70-U model
// CK-D820 (6x8) for D80-S model
-// CK-D868 (6x8) for D80 (non-S)
-// D90 can use _all_ of htese types except for the -U!
+// D90 can use _all_ of these types except for the -U!
}
@@ -893,16 +912,16 @@ repeat:
}
} else if (ctx->type == P_FUJI_ASK300) {
ctx->laminatefname = CORRTABLE_PATH "/ASK300M2.raw"; // Same as D70
- ctx->lutfname = CORRTABLE_PATH "/CPD70L01.lut"; // XXX guess, driver did not come with external LUT!
+// ctx->lutfname = CORRTABLE_PATH "/CPD70L01.lut"; // XXX guess, driver did not come with external LUT!
if (mhdr.speed == 3 || mhdr.speed == 4) {
mhdr.speed = 3; /* Super Fine */
ctx->cpcfname = CORRTABLE_PATH "/ASK300T3.cpc";
} else {
ctx->cpcfname = CORRTABLE_PATH "/ASK300T1.cpc";
}
- if (mhdr.hdr[3] != 0x01) {
+ if (mhdr.hdr[3] != 0x80) {
WARNING("Print job has wrong submodel specifier (%x)\n", mhdr.hdr[3]);
- mhdr.hdr[3] = 0x01;
+ mhdr.hdr[3] = 0x80;
}
}
if (!mhdr.use_lut)
@@ -1271,9 +1290,9 @@ static int mitsu70x_set_sleeptime(struct mitsu70x_ctx *ctx, uint8_t time)
uint8_t cmdbuf[4];
int ret;
- /* 10 minutes max, according to all docs. */
- if (time > 10)
- time = 10;
+ /* 60 minutes max, according to all docs. */
+ if (time > 60)
+ time = 60;
/* Send Parameter.. */
memset(cmdbuf, 0, 4);
@@ -1471,6 +1490,9 @@ top:
if (ctx->type == P_KODAK_305) {
if (be16_to_cpu(resp.vers[0].checksum) != EK305_0104_M_CSUM)
WARNING("Printer FW out of date. Highly recommend upgrading EK305 to v1.04!\n");
+ } else if (ctx->type == P_MITSU_K60) {
+ if (be16_to_cpu(resp.vers[0].checksum) != MK60S_0105_M_CSUM)
+ WARNING("Printer FW out of date. Highly recommend upgrading K60 to v1.05!\n");
} else if (ctx->type == P_MITSU_D70X) {
if (be16_to_cpu(resp.vers[0].checksum) != MD70X_0112_M_CSUM)
WARNING("Printer FW out of date. Highly recommend upgrading D70/D707 to v1.12!\n");
@@ -1602,11 +1624,19 @@ skip_status:
ctx->last_donor_l = donor_l;
ctx->last_donor_u = donor_u;
ATTR("marker-levels=%d,%d\n", donor_l, donor_u);
+ ATTR("marker-message='\"%d native prints remaining on %s media\"','\"%d native prints remaining on %s media\"'\n",
+ be16_to_cpu(resp.lower.remain),
+ mitsu70x_media_types(resp.lower.media_brand, resp.lower.media_type),
+ be16_to_cpu(resp.upper.remain),
+ mitsu70x_media_types(resp.upper.media_brand, resp.upper.media_type));
}
} else {
if (donor_l != ctx->last_donor_l) {
ctx->last_donor_l = donor_l;
ATTR("marker-levels=%d\n", donor_l);
+ ATTR("marker-message=\"%d native prints remaining on %s media\"\n",
+ be16_to_cpu(resp.lower.remain),
+ mitsu70x_media_types(resp.lower.media_brand, resp.lower.media_type));
}
}
@@ -1873,7 +1903,7 @@ static int mitsu70x_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend mitsu70x_backend = {
.name = "Mitsubishi CP-D70/D707/K60/D80",
- .version = "0.61",
+ .version = "0.66",
.uri_prefix = "mitsu70x",
.cmdline_usage = mitsu70x_cmdline,
.cmdline_arg = mitsu70x_cmdline_arg,
@@ -1889,7 +1919,7 @@ struct dyesub_backend mitsu70x_backend = {
{ USB_VID_MITSU, USB_PID_MITSU_D80, P_MITSU_D80, ""},
// { USB_VID_MITSU, USB_PID_MITSU_D90, P_MITSU_D90, ""},
{ USB_VID_KODAK, USB_PID_KODAK305, P_KODAK_305, ""},
-// { USB_VID_FUJIFILM, USB_PID_FUJI_ASK300, P_FUJI_ASK300, ""},
+ { USB_VID_FUJIFILM, USB_PID_FUJI_ASK300, P_FUJI_ASK300, ""},
{ 0, 0, 0, ""}
}
};
@@ -1913,23 +1943,23 @@ struct dyesub_backend mitsu70x_backend = {
1b 5a 54 PP JJ JJ RR RR 00 00 00 00 00 00 00 00
XX XX YY YY QQ QQ ZZ ZZ SS 00 00 00 00 00 00 00
UU 00 00 00 00 00 00 00 LL TT 00 00 00 00 00 00
- RR 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ MM 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
(padded by NULLs to a 512-byte boundary)
- PP == 0x01 on D70x/D80/ASK300, 0x00 on K60, 0x90 on K305
+ PP == 0x01 on D70x/D80, 0x00 on K60, 0x90 on K305, 0x80 on ASK300
JJ JJ == Job ID, can leave at 00 00
XX XX == columns
YY YY == rows
QQ QQ == lamination columns (equal to XX XX)
ZZ ZZ == lamination rows (YY YY + 12 on D70x/D80/ASK300, YY YY on others)
- RR RR == "rewind inhibit", 01 01 enabled, normally 00 00 (All but D70x)
+ RR RR == "rewind inhibit", 01 01 enabled, normally 00 00 (All but D70x/A300)
SS == Print mode: 00 = Fine, 03 = SuperFine (D70x/D80 only), 04 = UltraFine
(Matte requires Superfine or Ultrafine)
UU == 00 = Auto, 01 = Lower Deck (required for !D70x), 02 = Upper Deck
LL == lamination enable, 00 == on, 01 == off
- TT == lamination mode: 00 glossy, 02 matte.
- RR == 00 (normal), 01 = (Double-cut 4x6), 05 = (double-cut 2x6)
+ TT == lamination mode: 00 glossy, 02 matte
+ MM == 00 (normal), 01 = (Double-cut 4x6), 05 = (double-cut 2x6)
Data planes:
16-bit data, rounded up to 512-byte block (XX * YY * 2 bytes)
diff --git a/src/cups/backend_sonyupdr150.c b/src/cups/backend_sonyupdr150.c
index 622be40..dae8bf1 100644
--- a/src/cups/backend_sonyupdr150.c
+++ b/src/cups/backend_sonyupdr150.c
@@ -216,7 +216,7 @@ static int updr150_read_parse(void *vctx, int data_fd) {
static int updr150_main_loop(void *vctx, int copies) {
struct updr150_ctx *ctx = vctx;
- int i = 0, ret;
+ int i, ret;
if (!ctx)
return CUPS_BACKEND_FAILED;
@@ -228,6 +228,7 @@ static int updr150_main_loop(void *vctx, int copies) {
}
top:
+ i = 0;
while (i < ctx->datalen) {
uint32_t len;
memcpy(&len, ctx->databuf + i, sizeof(len));
@@ -276,7 +277,7 @@ static int updr150_cmdline_arg(void *vctx, int argc, char **argv)
struct dyesub_backend updr150_backend = {
.name = "Sony UP-DR150/UP-DR200/UP-CR10",
- .version = "0.18",
+ .version = "0.19",
.uri_prefix = "sonyupdr150",
.cmdline_arg = updr150_cmdline_arg,
.init = updr150_init,
diff --git a/src/cups/blacklist b/src/cups/blacklist
index ed9399f..0ca284c 100644
--- a/src/cups/blacklist
+++ b/src/cups/blacklist
@@ -214,3 +214,7 @@
# CIAAT Brava 21
0x10ce 0x001e blacklist
+
+# Fujifilm ASK-300
+0x04cb 0x5006 blacklist
+
diff --git a/src/cups/genppd.c b/src/cups/genppd.c
index 2e47f34..2ae4124 100644
--- a/src/cups/genppd.c
+++ b/src/cups/genppd.c
@@ -123,7 +123,7 @@ typedef struct /**** Media size values ****/
{
const char *name, /* Media size name */
*text; /* Media size text */
- int width, /* Media width */
+ stp_dimension_t width, /* Media width */
height, /* Media height */
left, /* Media left margin */
right, /* Media right margin */
@@ -1246,10 +1246,10 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
int num_opts;
paper_t *the_papers;
int i;
- int width, height, /* Page information */
+ stp_dimension_t width, height, /* Page information */
bottom, left,
top, right;
- int min_width, /* Min/max custom size */
+ stp_dimension_t min_width, /* Min/max custom size */
min_height,
max_width,
max_height;
@@ -1277,6 +1277,7 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
continue;
}
if (simplified && num_opts >= 10 &&
+ (!desc.deflt.str || strcmp(opt->name, desc.deflt.str) != 0) &&
(papersize->paper_unit == PAPERSIZE_ENGLISH_EXTENDED ||
papersize->paper_unit == PAPERSIZE_METRIC_EXTENDED))
continue;
@@ -1334,7 +1335,7 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
for (i = 0; i < cur_opt; i ++)
{
gpprintf(fp, "*PageSize %s", the_papers[i].name);
- gpprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
+ gpprintf(fp, "/%s:\t\"<</PageSize[%.3f %.3f]/ImagingBBox null>>setpagedevice\"\n",
the_papers[i].text, the_papers[i].width, the_papers[i].height);
}
gpputs(fp, "*CloseUI: *PageSize\n\n");
@@ -1349,7 +1350,7 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
for (i = 0; i < cur_opt; i ++)
{
gpprintf(fp, "*PageRegion %s", the_papers[i].name);
- gpprintf(fp, "/%s:\t\"<</PageSize[%d %d]/ImagingBBox null>>setpagedevice\"\n",
+ gpprintf(fp, "/%s:\t\"<</PageSize[%.3f %.3f]/ImagingBBox null>>setpagedevice\"\n",
the_papers[i].text, the_papers[i].width, the_papers[i].height);
}
gpputs(fp, "*CloseUI: *PageRegion\n\n");
@@ -1359,7 +1360,7 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
for (i = 0; i < cur_opt; i ++)
{
gpprintf(fp, "*ImageableArea %s", the_papers[i].name);
- gpprintf(fp, "/%s:\t\"%d %d %d %d\"\n", the_papers[i].text,
+ gpprintf(fp, "/%s:\t\"%.3f %.3f %.3f %.3f\"\n", the_papers[i].text,
the_papers[i].left, the_papers[i].bottom,
the_papers[i].right, the_papers[i].top);
}
@@ -1371,7 +1372,7 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
for (i = 0; i < cur_opt; i ++)
{
gpprintf(fp, "*PaperDimension %s", the_papers[i].name);
- gpprintf(fp, "/%s:\t\"%d %d\"\n",
+ gpprintf(fp, "/%s:\t\"%.3f %.3f\"\n",
the_papers[i].text, the_papers[i].width, the_papers[i].height);
}
gpputs(fp, "\n");
@@ -1391,14 +1392,14 @@ print_page_sizes(gpFile fp, stp_vars_t *v, int simplified,
if (right > width)
width = right;
- gpprintf(fp, "*MaxMediaWidth: \"%d\"\n", max_width);
- gpprintf(fp, "*MaxMediaHeight: \"%d\"\n", max_height);
- gpprintf(fp, "*HWMargins: %d %d %d %d\n",
+ gpprintf(fp, "*MaxMediaWidth: \"%.3f\"\n", max_width);
+ gpprintf(fp, "*MaxMediaHeight: \"%.3f\"\n", max_height);
+ gpprintf(fp, "*HWMargins: %.3f %.3f %.3f %.3f\n",
left, height - bottom, width - right, top);
gpputs(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
- gpprintf(fp, "*ParamCustomPageSize Width: 1 points %d %d\n",
+ gpprintf(fp, "*ParamCustomPageSize Width: 1 points %.3f %.3f\n",
min_width, max_width);
- gpprintf(fp, "*ParamCustomPageSize Height: 2 points %d %d\n",
+ gpprintf(fp, "*ParamCustomPageSize Height: 2 points %.3f %.3f\n",
min_height, max_height);
gpputs(fp, "*ParamCustomPageSize WidthOffset: 3 points 0 0\n");
gpputs(fp, "*ParamCustomPageSize HeightOffset: 4 points 0 0\n");
@@ -1747,15 +1748,15 @@ print_one_option(gpFile fp, stp_vars_t *v, const stp_string_list_t *po,
gpprintf(fp, "*StpStp%s: %d %d %d %d %d %.3f %.3f %.3f\n",
desc->name, desc->p_type, desc->is_mandatory,
desc->p_class, desc->p_level, desc->channel,
- (double) desc->bounds.dimension.lower,
- (double) desc->bounds.dimension.upper,
- (double) desc->deflt.dimension);
+ desc->bounds.dimension.lower,
+ desc->bounds.dimension.upper,
+ desc->deflt.dimension);
if (desc->is_mandatory)
{
gpprintf(fp, "*DefaultStp%s: %d\n",
- desc->name, desc->deflt.dimension);
+ desc->name, (int) desc->deflt.dimension);
gpprintf(fp, "*StpDefaultStp%s: %d\n",
- desc->name, desc->deflt.dimension);
+ desc->name, (int) desc->deflt.dimension);
}
else
{
@@ -1765,8 +1766,8 @@ print_one_option(gpFile fp, stp_vars_t *v, const stp_string_list_t *po,
}
if (!skip_color)
{
- for (i = desc->bounds.dimension.lower;
- i <= desc->bounds.dimension.upper; i++)
+ for (i = (int) desc->bounds.dimension.lower;
+ i <= (int) desc->bounds.dimension.upper; i++)
{
snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
(double)i * 25.4 / 72.0);
@@ -1777,6 +1778,15 @@ print_one_option(gpFile fp, stp_vars_t *v, const stp_string_list_t *po,
print_close_ui = 0;
gpprintf(fp, "*CloseUI: *Stp%s\n\n", desc->name);
+ /*
+ * Add custom option code and value parameter...
+ */
+
+ gpprintf(fp, "*CustomStp%s True: \"pop\"\n", desc->name);
+ gpprintf(fp, "*ParamCustomStp%s Value/%s: 1 points %d %d\n\n",
+ desc->name, _("Value"), (int) desc->bounds.dimension.lower,
+ (int) desc->bounds.dimension.upper);
+
break;
case STP_PARAMETER_TYPE_INT:
gpprintf(fp, "*OPOptionHints Stp%s: \"input spinbox\"\n", lparam->name);
@@ -1892,14 +1902,16 @@ print_one_localization(gpFile fp, const stp_string_list_t *po,
gpprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc->name,
"None", _("None"));
/* Unlike the other fields, dimensions are not strictly numbers */
- for (i = desc->bounds.dimension.lower;
- i <= desc->bounds.dimension.upper; i++)
+ for (i = (int) desc->bounds.dimension.lower;
+ i <= (int) desc->bounds.dimension.upper; i++)
{
snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
(double)i * 25.4 / 72.0);
gpprintf(fp, "*%s.Stp%s %d/%s: \"\"\n", lang,
desc->name, i, dimstr);
}
+ gpprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
+ desc->name, _("Value"));
break;
case STP_PARAMETER_TYPE_INT:
@@ -1977,7 +1989,7 @@ write_ppd(
{
int i, j, k, l; /* Looping vars */
int num_opts; /* Number of printer options */
- int xdpi, ydpi; /* Resolution info */
+ stp_resolution_t xdpi, ydpi; /* Resolution info */
stp_vars_t *v; /* Variable info */
const char *driver; /* Driver name */
const char *family; /* Printer family */
@@ -2207,7 +2219,7 @@ write_ppd(
}
gpprintf(fp, "*%sStpQuality %s/%s:\t\"<</HWResolution[%d %d]/cupsRowFeed %d>>setpagedevice\"\n",
nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
- opt->name, stp_i18n_lookup(po, opt->text), xdpi, ydpi, i + 1);
+ opt->name, stp_i18n_lookup(po, opt->text), (int) xdpi, (int) ydpi, i + 1);
}
gpputs(fp, "*CloseUI: *StpQuality\n\n");
}
@@ -2231,7 +2243,7 @@ write_ppd(
stp_string_list_t *res_list = stp_string_list_create();
char res_name[64]; /* Plenty long enough for XXXxYYYdpi */
int resolution_ok;
- int tmp_xdpi, tmp_ydpi;
+ stp_resolution_t tmp_xdpi, tmp_ydpi;
if (is_color_opt)
gpprintf(fp, "*ColorKeyWords: \"Resolution\"\n");
@@ -2267,13 +2279,13 @@ write_ppd(
excess resolution. However, make the hardware resolution
match the printer default.
*/
- (void) snprintf(res_name, 63, "%dx%ddpi", tmp_xdpi + 1, tmp_xdpi);
+ (void) snprintf(res_name, 63, "%dx%ddpi", (int) tmp_xdpi + 1, (int) tmp_xdpi);
default_resolution = stp_strdup(res_name);
stp_string_list_add_string(res_list, res_name, res_name);
gpprintf(fp, "*DefaultResolution: %s\n", res_name);
gpprintf(fp, "*StpDefaultResolution: %s\n", res_name);
gpprintf(fp, "*Resolution %s/%s:\t\"<</HWResolution[%d %d]>>setpagedevice\"\n",
- res_name, _("Automatic"), xdpi, ydpi);
+ res_name, _("Automatic"), (int) xdpi, (int) ydpi);
gpprintf(fp, "*StpResolutionMap: %s %s\n", res_name, "None");
}
else
@@ -2282,9 +2294,9 @@ write_ppd(
stp_describe_resolution(v, &xdpi, &ydpi);
if (xdpi == ydpi)
- (void) snprintf(res_name, 63, "%ddpi", xdpi);
+ (void) snprintf(res_name, 63, "%ddpi", (int) xdpi);
else
- (void) snprintf(res_name, 63, "%dx%ddpi", xdpi, ydpi);
+ (void) snprintf(res_name, 63, "%dx%ddpi", (int) xdpi, (int) ydpi);
gpprintf(fp, "*DefaultResolution: %s\n", res_name);
gpprintf(fp, "*StpDefaultResolution: %s\n", res_name);
/*
@@ -2319,9 +2331,9 @@ write_ppd(
do
{
if (tmp_xdpi == tmp_ydpi)
- (void) snprintf(res_name, 63, "%ddpi", tmp_xdpi);
+ (void) snprintf(res_name, 63, "%ddpi", (int) tmp_xdpi);
else
- (void) snprintf(res_name, 63, "%dx%ddpi", tmp_xdpi, tmp_ydpi);
+ (void) snprintf(res_name, 63, "%dx%ddpi", (int) tmp_xdpi, (int) tmp_ydpi);
if ((!has_quality_parameter &&
strcmp(opt->name, desc.deflt.str) == 0) ||
!stp_string_list_is_present(res_list, res_name))
@@ -2343,7 +2355,7 @@ write_ppd(
stp_string_list_add_string(resolutions, res_name, opt->text);
gpprintf(fp, "*%sResolution %s/%s:\t\"<</HWResolution[%d %d]/cupsCompression %d>>setpagedevice\"\n",
nocolor && strcmp(opt->name, desc.deflt.str) != 0 ? "?" : "",
- res_name, stp_i18n_lookup(po, opt->text), xdpi, ydpi, i + 1);
+ res_name, stp_i18n_lookup(po, opt->text), (int) xdpi, (int) ydpi, i + 1);
if (strcmp(res_name, opt->name) != 0)
gpprintf(fp, "*StpResolutionMap: %s %s\n", res_name, opt->name);
}
diff --git a/src/cups/rastertoprinter.c b/src/cups/rastertoprinter.c
index 23faa85..0fa0668 100644
--- a/src/cups/rastertoprinter.c
+++ b/src/cups/rastertoprinter.c
@@ -94,6 +94,16 @@ typedef struct
int bottom_trim;
int adjusted_width;
int adjusted_height;
+ stp_dimension_t d_left;
+ stp_dimension_t d_right;
+ stp_dimension_t d_bottom;
+ stp_dimension_t d_top;
+ stp_dimension_t d_width;
+ stp_dimension_t d_height;
+ stp_dimension_t d_left_trim;
+ stp_dimension_t d_right_trim;
+ stp_dimension_t d_bottom_trim;
+ stp_dimension_t d_top_trim;
int last_percent;
int shrink_to_fit;
CUPS_HEADER_T header; /* Page header from file */
@@ -312,7 +322,7 @@ validate_options(stp_vars_t *v, cups_image_t *cups)
if (ps->width > 0)
{
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Setting page width to %d\n",
+ fprintf(stderr, "DEBUG: Gutenprint: Setting page width to %.3f\n",
ps->width);
if (ps->width < stp_get_page_width(v))
stp_set_page_width(v, ps->width);
@@ -320,7 +330,7 @@ validate_options(stp_vars_t *v, cups_image_t *cups)
if (ps->height > 0)
{
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Setting page height to %d\n",
+ fprintf(stderr, "DEBUG: Gutenprint: Setting page height to %.3f\n",
ps->height);
if (ps->height < stp_get_page_height(v))
stp_set_page_height(v, ps->height);
@@ -340,7 +350,7 @@ static stp_vars_t *
initialize_page(cups_image_t *cups, const stp_vars_t *default_settings,
const char *page_size_name)
{
- int tmp_left, tmp_right, tmp_top, tmp_bottom;
+ stp_dimension_t tmp_left, tmp_right, tmp_top, tmp_bottom;
stp_vars_t *v = stp_vars_create_copy(default_settings);
if (! suppress_messages)
@@ -417,7 +427,7 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings,
}
else if (stp_get_papersize_by_name(page_size_name))
{
- int width, height;
+ stp_dimension_t width, height;
if (!suppress_messages)
fprintf(stderr, "DEBUG: Gutenprint: Using page size %s with (%d, %d)\n",
page_size_name, cups->header.PageSize[1], cups->header.PageSize[0]);
@@ -469,16 +479,16 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings,
set_string_parameter(v, "JobMode", "Job");
validate_options(v, cups);
- stp_get_media_size(v, &(cups->width), &(cups->height));
+ stp_get_media_size(v, &(cups->d_width), &(cups->d_height));
stp_get_maximum_imageable_area(v, &tmp_left, &tmp_right,
&tmp_bottom, &tmp_top);
- stp_get_imageable_area(v, &(cups->left), &(cups->right),
- &(cups->bottom), &(cups->top));
+ stp_get_imageable_area(v, &(cups->d_left), &(cups->d_right),
+ &(cups->d_bottom), &(cups->d_top));
if (! suppress_messages)
{
- fprintf(stderr, "DEBUG: Gutenprint: limits w %d l %d r %d h %d t %d b %d\n",
- cups->width, cups->left, cups->right, cups->height, cups->top, cups->bottom);
- fprintf(stderr, "DEBUG: Gutenprint: max limits l %d r %d t %d b %d\n",
+ fprintf(stderr, "DEBUG: Gutenprint: limits w %.3f l %.3f r %.3f h %.3f t %.3f b %.3f\n",
+ cups->d_width, cups->d_left, cups->d_right, cups->d_height, cups->d_top, cups->d_bottom);
+ fprintf(stderr, "DEBUG: Gutenprint: max limits l %.3f r %.3f t %.3f b %.3f\n",
tmp_left, tmp_right, tmp_top, tmp_bottom);
}
@@ -486,94 +496,94 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings,
tmp_left = 0;
if (tmp_top < 0)
tmp_top = 0;
- if (tmp_right > tmp_left + cups->width)
- tmp_right = cups->width;
- if (tmp_bottom > tmp_top + cups->height)
- tmp_bottom = cups->height;
- if (tmp_left < cups->left)
+ if (tmp_right > tmp_left + cups->d_width)
+ tmp_right = cups->d_width;
+ if (tmp_bottom > tmp_top + cups->d_height)
+ tmp_bottom = cups->d_height;
+ if (tmp_left < cups->d_left)
{
if (cups->shrink_to_fit != 1)
{
- cups->left_trim = cups->left - tmp_left;
- tmp_left = cups->left;
+ cups->d_left_trim = cups->d_left - tmp_left;
+ tmp_left = cups->d_left;
}
else
- cups->left_trim = 0;
+ cups->d_left_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: left margin %d\n", cups->left_trim);
+ fprintf(stderr, "DEBUG: Gutenprint: left margin %.3f\n", cups->d_left_trim);
}
else
{
- cups->left_trim = 0;
+ cups->d_left_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Adjusting left margin from %d to %d\n",
- cups->left, tmp_left);
- cups->left = tmp_left;
+ fprintf(stderr, "DEBUG: Gutenprint: Adjusting left margin from %.3f to %.3f\n",
+ cups->d_left, tmp_left);
+ cups->d_left = tmp_left;
}
- if (tmp_right > cups->right)
+ if (tmp_right > cups->d_right)
{
if (cups->shrink_to_fit != 1)
{
- cups->right_trim = tmp_right - cups->right;
- tmp_right = cups->right;
+ cups->d_right_trim = tmp_right - cups->d_right;
+ tmp_right = cups->d_right;
}
else
- cups->right_trim = 0;
+ cups->d_right_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: right margin %d\n", cups->right_trim);
+ fprintf(stderr, "DEBUG: Gutenprint: right margin %.3f\n", cups->d_right_trim);
}
else
{
- cups->right_trim = 0;
+ cups->d_right_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Adjusting right margin from %d to %d\n",
- cups->right, tmp_right);
- cups->right = tmp_right;
+ fprintf(stderr, "DEBUG: Gutenprint: Adjusting right margin from %.3f to %.3f\n",
+ cups->d_right, tmp_right);
+ cups->d_right = tmp_right;
}
- if (tmp_top < cups->top)
+ if (tmp_top < cups->d_top)
{
if (cups->shrink_to_fit != 1)
{
- cups->top_trim = cups->top - tmp_top;
- tmp_top = cups->top;
+ cups->d_top_trim = cups->d_top - tmp_top;
+ tmp_top = cups->d_top;
}
else
- cups->top_trim = 0;
+ cups->d_top_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: top margin %d\n", cups->top_trim);
+ fprintf(stderr, "DEBUG: Gutenprint: top margin %.3f\n", cups->d_top_trim);
}
else
{
- cups->top_trim = 0;
+ cups->d_top_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Adjusting top margin from %d to %d\n",
- cups->top, tmp_top);
- cups->top = tmp_top;
+ fprintf(stderr, "DEBUG: Gutenprint: Adjusting top margin from %.3f to %.3f\n",
+ cups->d_top, tmp_top);
+ cups->d_top = tmp_top;
}
- if (tmp_bottom > cups->bottom)
+ if (tmp_bottom > cups->d_bottom)
{
if (cups->shrink_to_fit != 1)
{
- cups->bottom_trim = tmp_bottom - cups->bottom;
- tmp_bottom = cups->bottom;
+ cups->d_bottom_trim = tmp_bottom - cups->d_bottom;
+ tmp_bottom = cups->d_bottom;
}
else
- cups->bottom_trim = 0;
+ cups->d_bottom_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: bottom margin %d\n", cups->bottom_trim);
+ fprintf(stderr, "DEBUG: Gutenprint: bottom margin %.3f\n", cups->d_bottom_trim);
}
else
{
- cups->bottom_trim = 0;
+ cups->d_bottom_trim = 0;
if (! suppress_messages)
- fprintf(stderr, "DEBUG: Gutenprint: Adjusting bottom margin from %d to %d\n",
- cups->bottom, tmp_bottom);
- cups->bottom = tmp_bottom;
+ fprintf(stderr, "DEBUG: Gutenprint: Adjusting bottom margin from %.3f to %.3f\n",
+ cups->d_bottom, tmp_bottom);
+ cups->d_bottom = tmp_bottom;
}
if (cups->shrink_to_fit == 2)
{
- int t_left, t_right, t_bottom, t_top;
+ stp_dimension_t t_left, t_right, t_bottom, t_top;
stp_get_imageable_area(v, &(t_left), &(t_right), &(t_bottom), &(t_top));
stp_set_width(v, t_right - t_left);
stp_set_height(v, t_bottom - t_top);
@@ -582,36 +592,36 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings,
}
else
{
- stp_set_width(v, cups->right - cups->left);
- stp_set_height(v, cups->bottom - cups->top);
- stp_set_left(v, cups->left);
- stp_set_top(v, cups->top);
+ stp_set_width(v, cups->d_right - cups->d_left);
+ stp_set_height(v, cups->d_bottom - cups->d_top);
+ stp_set_left(v, cups->d_left);
+ stp_set_top(v, cups->d_top);
}
- cups->right = cups->width - cups->right;
+ cups->d_right = cups->d_width - cups->d_right;
if (cups->shrink_to_fit == 1)
- cups->width = tmp_right - tmp_left;
+ cups->d_width = tmp_right - tmp_left;
else
- cups->width = cups->width - cups->left - cups->right;
- cups->width = cups->header.HWResolution[0] * cups->width / 72;
- cups->left = cups->header.HWResolution[0] * cups->left / 72;
- cups->right = cups->header.HWResolution[0] * cups->right / 72;
- cups->left_trim = cups->header.HWResolution[0] * cups->left_trim / 72;
- cups->right_trim = cups->header.HWResolution[0] * cups->right_trim / 72;
+ cups->d_width = cups->d_width - cups->d_left - cups->d_right;
+ cups->width = cups->header.HWResolution[0] * cups->d_width / 72;
+ cups->left = cups->header.HWResolution[0] * cups->d_left / 72;
+ cups->right = cups->header.HWResolution[0] * cups->d_right / 72;
+ cups->left_trim = cups->header.HWResolution[0] * cups->d_left_trim / 72;
+ cups->right_trim = cups->header.HWResolution[0] * cups->d_right_trim / 72;
cups->adjusted_width = cups->width;
if (cups->adjusted_width > cups->header.cupsWidth)
cups->adjusted_width = cups->header.cupsWidth;
- cups->bottom = cups->height - cups->bottom;
+ cups->d_bottom = cups->d_height - cups->d_bottom;
if (cups->shrink_to_fit == 1)
- cups->height = tmp_bottom - tmp_top;
+ cups->d_height = tmp_bottom - tmp_top;
else
- cups->height = cups->height - cups->top - cups->bottom;
- cups->height = cups->header.HWResolution[1] * cups->height / 72;
- cups->top = cups->header.HWResolution[1] * cups->top / 72;
- cups->bottom = cups->header.HWResolution[1] * cups->bottom / 72;
- cups->top_trim = cups->header.HWResolution[1] * cups->top_trim / 72;
- cups->bottom_trim = cups->header.HWResolution[1] * cups->bottom_trim / 72;
+ cups->d_height = cups->d_height - cups->d_top - cups->d_bottom;
+ cups->height = cups->header.HWResolution[1] * cups->d_height / 72;
+ cups->top = cups->header.HWResolution[1] * cups->d_top / 72;
+ cups->bottom = cups->header.HWResolution[1] * cups->d_bottom / 72;
+ cups->top_trim = cups->header.HWResolution[1] * cups->d_top_trim / 72;
+ cups->bottom_trim = cups->header.HWResolution[1] * cups->d_bottom_trim / 72;
cups->adjusted_height = cups->height;
if (cups->adjusted_height > cups->header.cupsHeight)
cups->adjusted_height = cups->header.cupsHeight;
diff --git a/src/cups/test-rastertogutenprint.in b/src/cups/test-rastertogutenprint.in
index 91b27ad..75d4102 100755
--- a/src/cups/test-rastertogutenprint.in
+++ b/src/cups/test-rastertogutenprint.in
@@ -232,8 +232,9 @@ get_ppds() {
}
if [ -n "$make_ppds" -o ! -d ppd/C ] ; then
- make ppd-nonls
-## Not all systems can work with gzipped PPDs
+ rm -rf ppd/C # Clean out any leftover simplified PPDs
+ make ppd-nonls-a # that double the time for the test
+## not all systems can work with gzipped PPDs
find ppd/C -name '*.ppd.gz' | xargs gunzip -f
fi