head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.10 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.8 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.6 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.4 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.2 pkgsrc-2009Q4-base:1.2; locks; strict; comment @# @; 1.2 date 2009.09.09.19.57.05; author drochner; state dead; branches; next 1.1; 1.1 date 2009.07.28.18.22.49; author drochner; state Exp; branches; next ; desc @@ 1.2 log @update to 0.12.0 This is a major update, switches to the 0.12 release branch. Most notable change is that the color management stuff which we had as patches in pkgsrc is official now. Otherwise - many fixes and enhancements. (while this is a .0 release I've been tracking the 0.11.x snapshots and release candidate for a while so I don't expect big problems) @ text @$NetBSD: patch-an,v 1.1 2009/07/28 18:22:49 drochner Exp $ --- poppler/PSOutputDev.cc.orig 2009-05-02 14:14:57.000000000 +0200 +++ poppler/PSOutputDev.cc @@@@ -4565,6 +4565,8 @@@@ void PSOutputDev::doImageL2(Object *ref, GfxCMYK cmyk; int c; int col, i, j, x0, x1, y, maskXor; + + rectsOutLen = 0; // color key masking if (maskColors && colorMap && !inlineImg) { @@@@ -4573,7 +4575,7 @@@@ void PSOutputDev::doImageL2(Object *ref, numComps = colorMap->getNumPixelComps(); imgStr = new ImageStream(str, width, numComps, colorMap->getBits()); imgStr->reset(); - rects0Len = rects1Len = rectsOutLen = 0; + rects0Len = rects1Len = 0; rectsSize = rectsOutSize = 64; rects0 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect)); rects1 = (PSOutImgClipRect *)gmallocn(rectsSize, sizeof(PSOutImgClipRect)); @@@@ -4696,14 +4698,28 @@@@ void PSOutputDev::doImageL2(Object *ref, rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1; ++rectsOutLen; } - writePSFmt("{0:d} array 0\n", rectsOutLen * 4); - for (i = 0; i < rectsOutLen; ++i) { - writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n", - rectsOut[i].x0, rectsOut[i].y0, - rectsOut[i].x1 - rectsOut[i].x0, - rectsOut[i].y1 - rectsOut[i].y0); + if (rectsOutLen < 65536/4) { + writePSFmt("{0:d} array 0\n", rectsOutLen * 4); + for (i = 0; i < rectsOutLen; ++i) { + writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n", + rectsOut[i].x0, rectsOut[i].y0, + rectsOut[i].x1 - rectsOut[i].x0, + rectsOut[i].y1 - rectsOut[i].y0); + } + writePSFmt("pop {0:d} {1:d} pdfImClip\n", width, height); + } else { + // would be over the limit of array size. + // make each rectangle path and clip. + writePS("gsave newpath\n"); + for (i = 0; i < rectsOutLen; ++i) { + writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n", + ((double)rectsOut[i].x0)/width, + ((double)rectsOut[i].y0)/height, + ((double)(rectsOut[i].x1 - rectsOut[i].x0))/width, + ((double)(rectsOut[i].y1 - rectsOut[i].y0))/height); + } + writePS("clip\n"); } - writePSFmt("pop {0:d} {1:d} pdfImClip\n", width, height); gfree(rectsOut); gfree(rects0); gfree(rects1); @@@@ -4798,14 +4814,28 @@@@ void PSOutputDev::doImageL2(Object *ref, rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1; ++rectsOutLen; } - writePSFmt("{0:d} array 0\n", rectsOutLen * 4); - for (i = 0; i < rectsOutLen; ++i) { - writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n", - rectsOut[i].x0, rectsOut[i].y0, - rectsOut[i].x1 - rectsOut[i].x0, - rectsOut[i].y1 - rectsOut[i].y0); + if (rectsOutLen < 65536/4) { + writePSFmt("{0:d} array 0\n", rectsOutLen * 4); + for (i = 0; i < rectsOutLen; ++i) { + writePSFmt("[{0:d} {1:d} {2:d} {3:d}] pr\n", + rectsOut[i].x0, rectsOut[i].y0, + rectsOut[i].x1 - rectsOut[i].x0, + rectsOut[i].y1 - rectsOut[i].y0); + } + writePSFmt("pop {0:d} {1:d} pdfImClip\n", maskWidth, maskHeight); + } else { + // would be over the limit of array size. + // make each rectangle path and clip. + writePS("gsave newpath\n"); + for (i = 0; i < rectsOutLen; ++i) { + writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re\n", + ((double)rectsOut[i].x0)/maskWidth, + ((double)rectsOut[i].y0)/maskHeight, + ((double)(rectsOut[i].x1 - rectsOut[i].x0))/maskWidth, + ((double)(rectsOut[i].y1 - rectsOut[i].y0))/maskHeight); + } + writePS("clip\n"); } - writePSFmt("pop {0:d} {1:d} pdfImClip\n", maskWidth, maskHeight); gfree(rectsOut); gfree(rects0); gfree(rects1); @@@@ -5066,7 +5096,11 @@@@ void PSOutputDev::doImageL2(Object *ref, } if ((maskColors && colorMap && !inlineImg) || maskStr) { - writePS("pdfImClipEnd\n"); + if (rectsOutLen < 65536/4) { + writePS("pdfImClipEnd\n"); + } else { + writePS("grestore\n"); + } } } @ 1.1 log @pull a patch from upstream which fixes generation of invalid postscript files in some cases, bump PKGREVISION @ text @d1 1 a1 1 $NetBSD$ @