Revision: 8906 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8906&view=rev Author: efiring Date: 2011-01-12 07:53:37 +0000 (Wed, 12 Jan 2011)
Log Message: ----------- Fix eps distillation bbox bug; closes 3032385 Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/backends/backend_ps.py Modified: branches/v1_0_maint/lib/matplotlib/backends/backend_ps.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/backends/backend_ps.py 2011-01-12 03:18:02 UTC (rev 8905) +++ branches/v1_0_maint/lib/matplotlib/backends/backend_ps.py 2011-01-12 07:53:37 UTC (rev 8906) @@ -1363,7 +1363,8 @@ operators. The output is low-level, converting text to outlines. """ - paper_option = "-sPAPERSIZE=%s" % ptype + if eps: paper_option = "-dEPSCrop" + else: paper_option = "-sPAPERSIZE=%s" % ptype psfile = tmpfile + '.ps' outfile = tmpfile + '.output' @@ -1385,14 +1386,6 @@ shutil.move(psfile, tmpfile) - # While it is best if above steps preserve the original bounding - # box, it does not seems to be the case. pstoeps not only convert - # the input to eps format, but also restores the original bbox. - - if eps: - pstoeps(tmpfile, bbox, rotated=rotated) - - def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False): """ Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file. @@ -1432,17 +1425,9 @@ os.remove(tmpfile) shutil.move(psfile, tmpfile) - - # Similar to the gs_distillier case, ps2pdf does not seem to - # preserve the bbox of the original file (at least w/ gs - # 8.61). Thus, the original bbox need to be resotred. - - if eps: - pstoeps(tmpfile, bbox, rotated) for fname in glob.glob(tmpfile+'.*'): os.remove(fname) - def get_bbox_header(lbrt, rotated=False): """ return a postscript header stringfor the given bbox lbrt=(l, b, r, t). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins