[gs-commits] rev 11869 - trunk/gs/base

robin at ghostscript.com robin at ghostscript.com
Thu Oct 28 19:02:46 UTC 2010


Author: robin
Date: 2010-10-28 19:02:45 +0000 (Thu, 28 Oct 2010)
New Revision: 11869

Modified:
   trunk/gs/base/gdevtifs.c
Log:
Marcos points out that tiffscaled with -rR -dDownScaleFactor=D can produce
different sized images than just using -r(R*D) and a normal tiff device.
(Bug 691730). I'll concede he's probably right that this isn't ideal.

The difference was caused by me rounding the size up on a downscale so that
no information is lost.

This patch removes the rounding up. We can always add it again later if
we actually find a file where it makes a difference.

No expected cluster differences.



Modified: trunk/gs/base/gdevtifs.c
===================================================================
--- trunk/gs/base/gdevtifs.c	2010-10-28 16:53:34 UTC (rev 11868)
+++ trunk/gs/base/gdevtifs.c	2010-10-28 19:02:45 UTC (rev 11869)
@@ -320,11 +320,11 @@
                                 int                factor,
                                 int                adjustWidth)
 {
-    int width = (pdev->width + factor-1)/factor;
+    int width = pdev->width/factor;
     if (adjustWidth)
         width = fax_adjusted_width(width);
     TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, width);
-    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (pdev->height + factor-1)/factor);
+    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, pdev->height/factor);
     TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
     TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
 
@@ -720,7 +720,7 @@
     int max_size;
     int row;
     int n;
-    int width = (dev->width + factor-1)/factor;
+    int width = dev->width/factor;
     int awidth = width;
     int padWhite;
 
@@ -777,6 +777,7 @@
                          errors, mfs_data, padWhite);
         }
     }
+#if DISABLED_AS_WE_DONT_ROUND_UP_ANY_MORE
     if (n != 0)
     {
         row--;
@@ -789,6 +790,7 @@
         down_and_out(tif, data, max_size, factor, row/factor, awidth, errors,
                      mfs_data, padWhite);
     }
+#endif
 
     TIFFWriteDirectory(tif);
 cleanup:



More information about the gs-commits mailing list