[gs-commits] rev 11861 - in trunk/gs: base doc

robin at ghostscript.com robin at ghostscript.com
Wed Oct 27 12:45:49 UTC 2010


Author: robin
Date: 2010-10-27 12:45:49 +0000 (Wed, 27 Oct 2010)
New Revision: 11861

Modified:
   trunk/gs/base/gdevtfax.c
   trunk/gs/doc/Devices.htm
Log:
Fix Bug 691727.

Black and White Tiff based devices were not respecting the AdjustWidth
parameter. Fax based devices were applying it regardless, non faxed based
devices were not applying it at all. The documentation says they should
all default to applying it, but be controlled by the option.

In this commit, we change so that all black and white tiff based devices
(except tiffscaled) respect this parameter. We default to applying it in
fax devices, and not applying it in non-fax devices, so default behaviour
does not change. We also update the docs.

No expected differences.



Modified: trunk/gs/base/gdevtfax.c
===================================================================
--- trunk/gs/base/gdevtfax.c	2010-10-27 11:18:38 UTC (rev 11860)
+++ trunk/gs/base/gdevtfax.c	2010-10-27 12:45:49 UTC (rev 11861)
@@ -222,7 +222,7 @@
 			X_DPI, Y_DPI,
 			0, 0, 0, 0,	/* margins */
 			1, tifflzw_print_page),
-    1				/* AdjustWidth, not used */,
+    0				/* AdjustWidth */,
     0                           /* MinFeatureSize */,
     TIFF_DEFAULT_STRIP_SIZE	/* strip size byte count */,
     1                           /* lowest column in the high-order bit, not used */,
@@ -236,7 +236,7 @@
 			X_DPI, Y_DPI,
 			0, 0, 0, 0,	/* margins */
 			1, tiffpack_print_page),
-    1				/* AdjustWidth, not used */,
+    0				/* AdjustWidth */,
     0                           /* MinFeatureSize */,
     TIFF_DEFAULT_STRIP_SIZE	/* strip size byte count */,
     1                           /* lowest column in the high-order bit, not used */,
@@ -269,7 +269,9 @@
 {
     gx_device_tfax *tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, gdev_fax_adjusted_width(dev->width));
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
 
     tfax_set_fields(tfdev);
 
@@ -281,7 +283,9 @@
 {
     gx_device_tfax *tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, gdev_fax_adjusted_width(dev->width));
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
 
     tfax_set_fields(tfdev);
     if (tfdev->Compression == COMPRESSION_CCITTFAX3)
@@ -295,7 +299,9 @@
 {
     gx_device_tfax *tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, gdev_fax_adjusted_width(dev->width));
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
 
     tfax_set_fields(tfdev);
     if (tfdev->Compression == COMPRESSION_CCITTFAX3)
@@ -309,7 +315,9 @@
 {
     gx_device_tfax *tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, gdev_fax_adjusted_width(dev->width));
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
 
     tfax_set_fields(tfdev);
     if (tfdev->Compression == COMPRESSION_CCITTFAX4)
@@ -324,7 +332,9 @@
 {
     gx_device_tfax *const tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, dev->width);
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
     tfax_set_fields(tfdev);
     TIFFSetField(tfdev->tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
 
@@ -337,7 +347,9 @@
 {
     gx_device_tfax *const tfdev = (gx_device_tfax *)dev;
 
-    tfax_begin_page(tfdev, prn_stream, dev->width);
+    tfax_begin_page(tfdev, prn_stream,
+                    (tfdev->AdjustWidth > 0 ?
+                     gdev_fax_adjusted_width(dev->width) : dev->width));
     tfax_set_fields(tfdev);
     TIFFSetField(tfdev->tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
 

Modified: trunk/gs/doc/Devices.htm
===================================================================
--- trunk/gs/doc/Devices.htm	2010-10-27 11:18:38 UTC (rev 11860)
+++ trunk/gs/doc/Devices.htm	2010-10-27 12:45:49 UTC (rev 11861)
@@ -462,6 +462,8 @@
 </dl>
 </blockquote>
 
+<p>See the <tt>AdjustWidth</tt> option documentation below for important
+information about these devices.
 
 <h4>Options</h4>
 
@@ -537,7 +539,10 @@
 <dd>If this option is set then if the requested page width is in the range
 of either 1680..1736 or 2000..2056 columns, set the page width to A4
 (1728 columns) or B4 (2048 columns) respectively.
-This behavior is the default. Pass -dAdjustWidth=0 to turn off this behavior.
+This behavior is the default for all the fax based devices (i.e. all the black
+and white devices except <tt>tifflzw</tt> and <tt>tiffpack</tt>). Pass
+<tt>-dAdjustWidth=0</tt> to force this behaviour off, and
+<tt>-dAdjustWidth=1</tt> to force it on.
 
 <dt><code>-dMinFeatureSize=<em>state</em></code> (0 to 4; default = 1)
 <dd>This option allows a minimum feature size to be set; if any output pixel



More information about the gs-commits mailing list