Package: printer-driver-foo2zjs
Version: 20200505dfsg0-5
Severity: normal
Tags: patch

foo2qpdl's write_page_banded() (used for -z2 and -z3: CLP-310/315/325/
610, CLX-3175, CLP-620/360/365) labels every stripe record 128 rows
high and sends the JBIG BIH only once, for the first stripe. The last
stripe is encoded with only the rows that are left, so whenever the
clipped page height is not a multiple of 128 the printer decodes past
the end of that stripe's data.

With the default A4 clip (-u 150x100 -l 150x100, 7016 - 200 = 6816 rows
= 53 stripes + 32 rows), qpdldecode on foo2qpdl's output shows 54
stripes of H=128 for 6816 rows. On a Samsung Xpress C410W (driven as a
CLP-365, -z3) this prints a black bar below the page content. Letter (6400 
rows) is a multiple of 128, which is
probably why it went unnoticed.

qpdldecode -d itself decodes the missing 96 rows of the last stripe
as ink in all four planes (723k dots in the K plane on a test page).

To reproduce without a printer:

  foo2qpdl-wrapper -z3 -c -C10 -Gsamclp315-argyll-0.icm -r1200x600 -p2 \
      some-a4-page.ps > out.qpdl
  qpdldecode < out.qpdl | grep -c 'stripe='   # 216: 54 per plane, all H=128
  qpdldecode -d out < out.qpdl                # out-01-*.pbm: rows 6816+ inked

The attached patch pads the last stripe with blank rows and always
encodes 128 rows, so every row that printed before is unchanged.
Tested on the C410W: the black bar is gone, and rows 0-6815 decode
identically before and after.



-- System Information:
Debian Release: 13.6
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: arm64 (aarch64)

Kernel: Linux 7.2.8-edge-rockchip64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_IE.UTF-8, LC_CTYPE=en_IE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_IE.UTF-8), LANGUAGE=en_IE.UTF-8
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages printer-driver-foo2zjs depends on:
ii  cups-filters [foomatic-filters]  1.28.17-7+b3
ii  dc                               1.07.1-4+b2
ii  libc6                            2.43-7
ii  libcups2t64                      2.4.18-1
ii  libjbig0                         2.1-6.1+b3
ii  liblcms2-utils                   2.19.1-1
ii  printer-driver-foo2zjs-common    20200505dfsg0-5

Versions of packages printer-driver-foo2zjs recommends:
ii  cups         2.4.18-1
ii  cups-client  2.4.18-1
pn  mscompress   <none>
ii  unzip        6.0-31
ii  wget         1.25.0-3

Versions of packages printer-driver-foo2zjs suggests:
pn  hannah-foo2zjs  <none>
pn  psutils         <none>

-- no debconf information

Attachment: 0028-foo2qpdl-pad-the-last-stripe-to-128-rows.patch
Description: Binary data

Reply via email to