2004.10.25 15:46 "[Tiff] tiff2ps patch", by Tristan Hill

I had an issue with the BoundingBox in the output ps not being set correctly, causing the image not be scaled correctly. With the help of gdb this tracked down to the TIFFGetField [XY]RESOLUTION calls. The man page indicated that this uses a float rather than a double so I tried reverting the type which seems to fix it. I also changed other double types that said float in the man page.

Index: tiff2ps.c
===================================================================
RCS file: /cvs/maptools/cvsroot/libtiff/tools/tiff2ps.c,v
retrieving revision 1.28
diff -u -r1.28 tiff2ps.c
--- tiff2ps.c   10 Oct 2004 11:58:16 -0000      1.28
+++ tiff2ps.c   25 Oct 2004 15:32:50 -0000
@@ -411,7 +411,7 @@
 static void
 setupPageState(TIFF* tif, uint32* pw, uint32* ph, double* pprw, double* pprh)
 {
-       double xres = 0.0, yres = 0.0;
+       float xres = 0.0, yres = 0.0;

        TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, pw);
        TIFFGetField(tif, TIFFTAG_IMAGELENGTH, ph);
@@ -542,7 +542,8 @@
        double pw, double ph, double lm, double bm, int cnt)
 {
        uint32 w, h;
-       double ox, oy, prw, prh;
+       float ox, oy;
+       double prw, prh;
        double scale = 1.0;
        double left_offset = lm * PS_UNIT_SIZE;
        double bottom_offset = bm * PS_UNIT_SIZE;