diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-11-24 02:03:41 +0800 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-11-24 02:03:41 +0800 |
commit | f862a65828580fbc6dab928f422e29d003d41f4c (patch) | |
tree | 9556ba8c1c79f6ca284724cbc03370ff1eb84855 | |
parent | 88f68040f0a2216ed47044a3e1668549ac06fdad (diff) | |
download | freebsd-ports-graphics-f862a65828580fbc6dab928f422e29d003d41f4c.tar.gz freebsd-ports-graphics-f862a65828580fbc6dab928f422e29d003d41f4c.tar.zst freebsd-ports-graphics-f862a65828580fbc6dab928f422e29d003d41f4c.zip |
Tech fax2ps(1) how to work properly for non-Letter paper sizes.
PR: 32018
Submitted by: Helge Oldach <send-pr@oldach.net>
-rw-r--r-- | graphics/tiff/Makefile | 1 | ||||
-rw-r--r-- | graphics/tiff/files/patch-tools::fax2ps.c | 42 |
2 files changed, 43 insertions, 0 deletions
diff --git a/graphics/tiff/Makefile b/graphics/tiff/Makefile index 2a9c47d754b..45f3952c66f 100644 --- a/graphics/tiff/Makefile +++ b/graphics/tiff/Makefile @@ -9,6 +9,7 @@ PORTNAME= tiff PORTVERSION= 3.5.5 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= ftp://ftp.onshore.com/pub/libtiff/ \ http://www.libtiff.org/ diff --git a/graphics/tiff/files/patch-tools::fax2ps.c b/graphics/tiff/files/patch-tools::fax2ps.c new file mode 100644 index 00000000000..64fa98e675b --- /dev/null +++ b/graphics/tiff/files/patch-tools::fax2ps.c @@ -0,0 +1,42 @@ + +--- tools/fax2ps.c.orig Tue Sep 2 19:54:34 1997 ++++ tools/fax2ps.c Sat Feb 13 16:43:01 1999 +@@ -151,7 +151,7 @@ + { + uint32 w, h; + uint16 unit; +- float xres, yres; ++ float xres, yres, scale = 1.0; + tstrip_t s, ns; + + TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h); +@@ -174,21 +174,13 @@ + + printf("%%%%Page: \"%d\" %d\n", pageNumber, pageNumber); + printf("/$pageTop save def gsave\n"); +- if (scaleToPage) { +- float yscale = pageHeight / (h/yres); +- float xscale = pageWidth / (w/xres); +- printf("%d %d translate\n", +- (int) (((basePageWidth - pageWidth) * points) * half), +- (int)((yscale*(h/yres)*points) + +- (basePageHeight - pageHeight) * points * half) ); +- printf("%g %g scale\n", (72.*xscale)/xres, -(72.*yscale)/yres); +- } else { +- printf("%d %d translate\n", +- (int) ((basePageWidth - pageWidth) * points * half), +- (int)((72.*h/yres) + +- (basePageHeight - pageHeight) * points * half) ); +- printf("%g %g scale\n", 72./xres, -72./yres); +- } ++ if (scaleToPage) ++ scale = pageHeight / (h/yres) < pageWidth / (w/xres) ? ++ pageHeight / (h/yres) : pageWidth / (w/xres); ++ printf("%g %g translate\n", ++ points * (pageWidth - scale*w/xres) * half, ++ points * (scale*h/yres + (pageHeight - scale*h/yres) * half)); ++ printf("%g %g scale\n", points/xres*scale, -points/yres*scale); + printf("0 setgray\n"); + TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, printruns); + ns = TIFFNumberOfStrips(tif); + |