Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Till Kamppeter
There is no corresponding Ghostscript upstream bug, bug the following 
Ubuntu bug report:


https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/93

It is commit d6f83dfa81a.

   Till

--

commit d6f83dfa81a2073c3d1f67a30aee7e8407e4685a
Author: Ken Sharp 
Date:   Mon Mar 19 10:06:10 2012 +

ps2write - work-around bugs in Brother printer CCITTFaxDecode filter

Raised on irc by Till Kamppeter, see Ubuntu bug :

https://bugs.launchpad.net/ubuntu/+source/cups/+bug/93

After much work by Chris Liddell and Bruce Stough it transpires that at
least some Brother printers have a bug in their CCITTFaxDecode filter,
especially with small amounts of data.

Since the ps2write otuput for bitmapped glyhs (which is required 
when the
input is a CIDFont) always uses the CCITTFax filter, this led to 
corrupted
output from the Brother (Note this is a bug in the *printer* not 
ps2write)


This patch adds a new command line parameter 'NoT3CCITT' which disables
compression of bitmapped glyphs. It should only be used with 
printers which
have a problem with CCITTFax data, and in that case should also be 
used with
the EncodeMonoImages switch to disable compression of monochrome 
images. Eg:


-dNoT3CCITT -dEncodeMonoImages=false

No differences expected as these are not tested by our regression tests



--
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f6a5c3d.6060...@gmail.com



Processed: Re: Add an option to disable T3CCITT encoding

2012-03-21 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tags 664966 + fixed-upstream
Bug #664966 [ghostscript] Add an option to disable T3CCITT encoding
Added tag(s) fixed-upstream.
>
End of message, stopping processing here.

Please contact me if you need assistance.
-- 
664966: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=664966
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.c.13323701686051.transcr...@bugs.debian.org



Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Till Kamppeter
This patch is backported from upstream (see filename of the patch), so 
no upstream bug needs to get reported.


   Till



--
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f6a5ac0.70...@gmail.com



Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Jonathan Nieder
Jonas Smedegaard wrote:

> If applied upstream, do you then know the corresponding git commit and 
> issue tracker ID?

My bad.  Yep, this is already upstream:

 commit d6f83dfa81a2073c3d1f67a30aee7e8407e4685a
 Author: Ken Sharp 
 Date:   Mon Mar 19 10:06:10 2012 +

 ps2write - work-around bugs in Brother printer CCITTFaxDecode filter



-- 
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120321224658.GB10996@burratino



Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Jonas Smedegaard
On 12-03-21 at 11:09pm, Vincent Bernat wrote:
> Unfortunately, [cupsfilters 1.0.7] fix relies on a patch in 
> Ghostscript which is not applied in Debian. Please, apply it.

Thanks.

If applied upstream, do you then know the corresponding git commit and 
issue tracker ID?

(I can find it myself, just easier if you have it already).


 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private


signature.asc
Description: Digital signature


Processed: Re: Add an option to disable T3CCITT encoding

2012-03-21 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> tags 664966 + upstream
Bug #664966 [ghostscript] Add an option to disable T3CCITT encoding
Added tag(s) upstream.
> quit
Stopping processing here.

Please contact me if you need assistance.
-- 
664966: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=664966
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


--
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.c.13323694732906.transcr...@bugs.debian.org



Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Jonathan Nieder
tags 664966 + upstream
quit

Hi Vincent,

Vincent Bernat wrote:

> 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: #93).
>
> Unfortunately, this fix relies on a patch in Ghostscript which is not
> applied in Debian. Please, apply it.
[...]
> --- 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];
[...]
> --- 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.
> + */

This is internal to the PDF-writing driver, so not an ABI change (phew).

Makes sense.  Please report this upstream at
http://bugs.ghostscript.com/ and let us know the bug number so we can
track it.

Thanks,
Jonathan



-- 
To UNSUBSCRIBE, email to debian-printing-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120321223741.GA10996@burratino



Bug#664966: Add an option to disable T3CCITT encoding

2012-03-21 Thread Vincent Bernat
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: #93).

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  debianutils4.2.1
ii  gsfonts1: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 
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)\