Bug#740789: Alternate patch
Hi there,
The attached patch is (I think) an improvement on the patch submitted
above. Fixes the same bug, but in a slightly different way.
Thanks,
--
Phil.
philpem@philpem.me.uk
http://www.philpem.me.uk/
=== modified file 'debian/changelog'
--- debian/changelog 2013-09-12 21:32:52 +0000
+++ debian/changelog 2014-03-04 23:18:29 +0000
@@ -1,3 +1,10 @@
+ptouch-driver (1.3-7ubuntu1) UNRELEASED; urgency=low
+
+ * Add send-esc-i-A-for-QL-only.patch which prevents rastertoptch from
+ sending the "ESC i A" command to printers which do not support it.
+
+ -- Philip Pemberton <philpem@philpem.me.uk> Tue, 04 Mar 2014 23:04:13 +0000
+
ptouch-driver (1.3-7) unstable; urgency=low
* Rebuild against pyppd >= 1.0.1
=== added file 'debian/patches/send-esc-i-A-for-QL-only.patch'
--- debian/patches/send-esc-i-A-for-QL-only.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/send-esc-i-A-for-QL-only.patch 2014-03-04 23:18:29 +0000
@@ -0,0 +1,50 @@
+Index: ptouch-driver/rastertoptch.c
+===================================================================
+--- ptouch-driver.orig/rastertoptch.c 2014-03-04 22:51:59.000000000 +0000
++++ ptouch-driver/rastertoptch.c 2014-03-04 22:59:53.000000000 +0000
+@@ -685,7 +685,8 @@
+ inline void
+ emit_feed_cut_mirror (bool do_feed, unsigned feed,
+ bool do_cut,
+- bool do_mirror) {
++ bool do_mirror,
++ xfer_t xfer_mode) {
+ /* Determine feed nibble */
+ unsigned feed_nibble;
+ if (do_feed) {
+@@ -698,7 +699,14 @@
+ /* Determine mirror print bit*/
+ unsigned char mirror_bit = do_mirror ? 0x80 : 0x00;
+ /* Combine & emit printer command code */
+- putchar (ESC); putchar ('i'); putchar ('A'); putchar ((char) (do_cut ? 0x01 : 0x00));
++ if (xfer_mode == ULP) {
++ /* ESC i A is Enable Cutter -- used for QL-560 only, according to
++ * <http://www.undocprint.org/formats/page_description_languages/brother_p-touch>
++ * The QL-560 (actually the whole QL series) uses ULP mode, so we check for that.
++ * The PT2450DX uses RLE and throw an INTERFACE ERROR if it sees this command.
++ */
++ putchar (ESC); putchar ('i'); putchar ('A'); putchar ((char) (do_cut ? 0x01 : 0x00));
++ }
+ putchar (ESC); putchar ('i'); putchar ('M');
+ putchar ((char) (feed & 0x1f) | auto_cut_bit | mirror_bit);
+ }
+@@ -807,7 +815,8 @@
+ /* We only know how to feed after each page */
+ emit_feed_cut_mirror (perform_feed == CUPS_ADVANCE_PAGE, feed,
+ cut_media == CUPS_CUT_PAGE,
+- mirror == CUPS_TRUE);
++ mirror == CUPS_TRUE,
++ job_options->pixel_xfer == ULP);
+ /* Set media and quality if label preamble is requested */
+ unsigned page_size_y = new_page_options->page_size [1];
+ unsigned image_height_px = lrint (page_size_y * vres / 72.0);
+@@ -1527,7 +1536,8 @@
+ perform_feed == CUPS_ADVANCE_JOB,
+ new_page_options->feed,
+ cut_media == CUPS_CUT_PAGE || cut_media == CUPS_CUT_JOB,
+- new_page_options->mirror == CUPS_TRUE);
++ new_page_options->mirror == CUPS_TRUE,
++ job_options->pixel_xfer);
+ /* Emit eject marker */
+ putchar (PTC_EJECT);
+ }
=== modified file 'debian/patches/series'
--- debian/patches/series 2010-09-13 10:00:00 +0000
+++ debian/patches/series 2014-03-04 23:18:29 +0000
@@ -1,2 +1,3 @@
foomatic-data-fixes.patch
send-esc-i-A.patch
+send-esc-i-A-for-QL-only.patch
Reply to: