[PYTHON IMAGE-SIG] BUGFIX: Postscript Printing Problem

Fredrik Lundh fredrik_lundh@ivab.se
Thu, 20 Jun 1996 10:11:24 +0200


I finally got around to sort out that Postscript printing/EPS problem
in 0.1b1.

Haven't got any time right now to prepare a new release (there's too
many things being "almost ready" :-), so I thought I'd just post the
necessary changes instead.

Regards	/F

--------------------------------------------------------------------

In Lib/PSDraw.py:

	dx = (xmax - x) / 2 + box[0]
	dy = (ymax - y) / 2 + box[1]
+	self.fp.write("matrix currentmatrix\n")
	self.fp.write("%f %f translate\n" % (dx, dy))
	if (x, y) != im.size:
	    # EpsImagePlugin._save prints the image at (0,0,xsize,ysize)
	    sx = x / im.size[0]
	    sy = y / im.size[1]
	    self.fp.write("%f %f scale\n" % (sx, sy))
	EpsImagePlugin._save(im, self.fp, None, 0)
!	self.fp.write("\nsetmatrix\n")

In libImaging/EpsEncode.c:

	    if (++state->y >= state->ysize) {
		state->errcode = IMAGING_CODEC_END;
!		return ptr - buf;
	    }
	    in = (UINT8*) im->image[state->y];
	}

=================
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
=================