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

larsu at ghostscript.com larsu at ghostscript.com
Mon Mar 15 19:00:43 UTC 2010


Author: larsu
Date: 2010-03-15 19:00:43 +0000 (Mon, 15 Mar 2010)
New Revision: 10927

Modified:
   trunk/gs/base/gdevtfnx.c
   trunk/gs/base/gdevtifs.c
   trunk/gs/base/gdevtsep.c
Log:
Write TIFF directories before the page data.  This might help bug #691172 and
probably some other non-conforming TIFF readers.



Modified: trunk/gs/base/gdevtfnx.c
===================================================================
--- trunk/gs/base/gdevtfnx.c	2010-03-15 15:21:55 UTC (rev 10926)
+++ trunk/gs/base/gdevtfnx.c	2010-03-15 19:00:43 UTC (rev 10927)
@@ -107,6 +107,8 @@
     TIFFSetField(tfdev->tif, TIFFTAG_BITSPERSAMPLE, 4);
     tiff_set_rgb_fields(tfdev);
 
+    TIFFCheckpointDirectory(tfdev->tif);
+
     /* Write the page data. */
     {
 	int y;

Modified: trunk/gs/base/gdevtifs.c
===================================================================
--- trunk/gs/base/gdevtifs.c	2010-03-15 15:21:55 UTC (rev 10926)
+++ trunk/gs/base/gdevtifs.c	2010-03-15 19:00:43 UTC (rev 10927)
@@ -295,6 +295,8 @@
     if (data == NULL)
 	return_error(gs_error_VMerror);
 
+    TIFFCheckpointDirectory(tif);
+
     memset(data, 0, max_size);
     for (row = 0; row < dev->height; row++) {
 	code = gdev_prn_copy_scan_lines(dev, row, data, size);

Modified: trunk/gs/base/gdevtsep.c
===================================================================
--- trunk/gs/base/gdevtsep.c	2010-03-15 15:21:55 UTC (rev 10926)
+++ trunk/gs/base/gdevtsep.c	2010-03-15 19:00:43 UTC (rev 10927)
@@ -1439,6 +1439,10 @@
 	    return_error(gs_error_VMerror);
 	}
 
+	for (comp_num = 0; comp_num < num_comp; comp_num++ )
+	    TIFFCheckpointDirectory(tfdev->tiff[comp_num]);
+	TIFFCheckpointDirectory(tfdev->tiff_comp);
+
         /* Write the page data. */
 	for (y = 0; y < pdev->height; ++y) {
 	    code = gdev_prn_get_bits(pdev, y, line, &row);
@@ -1604,6 +1608,9 @@
 	if (line == NULL || unpacked == NULL || dithered_line == NULL)
 	    return_error(gs_error_VMerror);
 
+        for (comp_num = 0; comp_num < num_comp; comp_num++ )
+	    TIFFCheckpointDirectory(tfdev->tiff[comp_num]);
+
         /* Loop for the lines */
 	for (y = 0; y < pdev->height; ++y) {
 	    code = gdev_prn_get_bits(pdev, y, line, &row);



More information about the gs-commits mailing list