kodak68xx: Improved sanity checking for jobs.

This commit is contained in:
Solomon Peachy 2019-05-12 08:10:17 -04:00
parent d10a4ffc45
commit 48a1d90c2c
2 changed files with 26 additions and 19 deletions

View file

@ -1179,24 +1179,27 @@ static int kodak6800_read_parse(void *vctx, const void **vjob, int data_fd, int
job->datalen += 1844*2*3;
}
/* Some header jiggery */
if (cols == 1844)
job->hdr.size = 6;
else if (cols == 1548)
job->hdr.size = 7;
if (rows == 636) {
job->hdr.method = 0x21;
} else if (rows == 936) {
job->hdr.method = 0x23;
} else if (rows == 1240) {
job->hdr.method = 0x01;
} else if (rows == 1282) {
job->hdr.method = 0x20;
} else if (rows == 1882) {
job->hdr.method = 0x22;
} else if (rows == 2490) {
job->hdr.method = 0x2;
/* Perform some header re-jiggery */
if (job->hdr.size == 0) {
if (cols == 1844)
job->hdr.size = 6;
else if (cols == 1548)
job->hdr.size = 7;
}
if (job->hdr.method == 0) {
if (rows == 636) {
job->hdr.method = 0x21;
} else if (rows == 936) {
job->hdr.method = 0x23;
} else if (rows == 1240) {
job->hdr.method = 0x01;
} else if (rows == 1282) {
job->hdr.method = 0x20;
} else if (rows == 1882) {
job->hdr.method = 0x22;
} else if (rows == 2490) {
job->hdr.method = 0x2;
}
}
/* Fix max print count. */
@ -1364,7 +1367,7 @@ static const char *kodak6800_prefixes[] = {
/* Exported */
struct dyesub_backend kodak6800_backend = {
.name = "Kodak 6800/6850",
.version = "0.69",
.version = "0.70",
.uri_prefixes = kodak6800_prefixes,
.cmdline_usage = kodak6800_cmdline,
.cmdline_arg = kodak6800_cmdline_arg,

View file

@ -55,7 +55,11 @@ kodak-805,kodak805,0x040a,0x4034,,PageSize=Legal
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w144h432
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w216h432
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w288h432
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w288h432-div2
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h432
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h432-div2
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h576
kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h576-div2
kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w144h432
kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w216h432
kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w288h432

1 #gp_printername,backend,vid,pid,type,gp_options
55 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w144h432
56 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w216h432
57 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w288h432
58 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w288h432-div2
59 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h432
60 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h432-div2
61 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h576
62 kodak-6800,kodak6800,0x040a,0x4021,0xb,PageSize=w432h576-div2
63 kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w144h432
64 kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w216h432
65 kodak-6850,kodak6850,0x040a,0x402b,0xb,PageSize=w288h432