[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#664966: Add an option to disable T3CCITT encoding



Package: ghostscript
Version: 9.05~dfsg-3
Severity: important
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

cupsfilters 1.0.7 include a fix for Brother printers to workaround a
bug in the Postscript interpreter:

     - pdftops: Additional workaround for a bug in the PostsSript interpreters
       of Brother printers, calling Ghostscript with special command line
       options (LP: #955553).

Unfortunately, this fix relies on a patch in Ghostscript which is not
applied in Debian. Please, apply it.

Thanks.

- -- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ghostscript depends on:
ii  debconf [debconf-2.0]  1.5.42
ii  debianutils            4.2.1
ii  gsfonts                1:8.11+urwcyr1.0.7~pre44-4.2
ii  libc6                  2.13-27
ii  libgs9                 9.05~dfsg-3

ghostscript recommends no packages.

Versions of packages ghostscript suggests:
ii  ghostscript-cups  9.05~dfsg-3
ii  ghostscript-x     <none>
ii  hpijs             3.12.2-1

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAk9qUaUACgkQKFvXofIqeU6rAgCgrr//j6jkXJV5jpQ+k4E8Zrt/
pkwAoJYl+aUutf7eeNhxCWZEwsqj3HO2
=qb0m
-----END PGP SIGNATURE-----
--- a/base/gdevpdfb.c
+++ b/base/gdevpdfb.c
@@ -293,16 +293,18 @@
      * that would need to be passed.
      */
     if (pres) {
-        /*
-         * Always use CCITTFax 2-D for character bitmaps.  It takes less
-         * space to invert the data with Decode than to set BlackIs1.
-         */
-        float d0 = image.Decode[0];
+        if (!pdev->NoT3CCITT) {
+            /*
+             * Always use CCITTFax 2-D for character bitmaps.  It takes less
+             * space to invert the data with Decode than to set BlackIs1.
+             */
+            float d0 = image.Decode[0];
 
-        image.Decode[0] = image.Decode[1];
-        image.Decode[1] = d0;
-        psdf_CFE_binary(&writer.binary[0], image.Width, image.Height, true);
-        invert ^= 0xff;
+            image.Decode[0] = image.Decode[1];
+            image.Decode[1] = d0;
+            psdf_CFE_binary(&writer.binary[0], image.Width, image.Height, true);
+            invert ^= 0xff;
+        }
     } else {
         /* Use the Distiller compression parameters. */
         pdev->ParamCompatibilityLevel = pdev->CompatibilityLevel;
--- a/base/gdevpdfb.h
+++ b/base/gdevpdfb.h
@@ -266,5 +266,6 @@
  PDF_FOR_OPDFREAD,		/* AllowPSRepeatFunctions */
  true,				/* IsDistiller (true even for ps2write!) */
  !PDF_FOR_OPDFREAD,		/* PreserveSMask */
- !PDF_FOR_OPDFREAD		/* PreserveTrMode */
+ !PDF_FOR_OPDFREAD,		/* PreserveTrMode */
+ false                          /* NoT3CCITT */
 };
--- a/base/gdevpdfp.c
+++ b/base/gdevpdfp.c
@@ -121,6 +121,7 @@
     pi("IsDistiller", gs_param_type_bool, IsDistiller),
     pi("PreserveSMask", gs_param_type_bool, PreserveSMask),
     pi("PreserveTrMode", gs_param_type_bool, PreserveTrMode),
+    pi("NoT3CCITT", gs_param_type_bool, NoT3CCITT),
 #undef pi
     gs_param_item_end
 };
--- a/base/gdevpdfx.h
+++ b/base/gdevpdfx.h
@@ -704,6 +704,11 @@
     bool IsDistiller;
     bool PreserveSMask;
     bool PreserveTrMode;
+    bool NoT3CCITT;                 /* A bug in Brother printers causes CCITTFaxDecode
+                                     * to fail, especially with small amounts of data.
+                                     * This parameter is present only to allow
+                                     * ps2write output to work on those pritners.
+                                     */
 };
 
 #define is_in_page(pdev)\

Reply to: