]> git.donarmstrong.com Git - lilypond.git/commitdiff
ps-to-png.scm: only use -dEPSCrop for EPS files.
authorPatrick McCarty <pnorcks@gmail.com>
Thu, 17 Jun 2010 22:41:52 +0000 (15:41 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Fri, 18 Jun 2010 20:26:36 +0000 (13:26 -0700)
The previous check for multi-page documents fails to account for
single-page PS files, which must have page sizes specified using
-dDEVICEWIDTHPOINTS and -dDEVICEHEIGHTPOINTS when converted to PNG.

This commit improves the situation: only use the -dEPSCrop option for
EPS files, which do not have a page count.  All files that specify a
page count (PS files), will now be converted to PNGs with correct
dimensions.

scm/ps-to-png.scm

index f25f8cb7ff82338a4c8716a226c81cb40d18a904..cbe6d23e4bae71023f0a525a66ff1f69600ef8c4 100644 (file)
          (output-file (if multi-page? pngn png1))
 
          (gs-variable-options
-          (if multi-page?
-              (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
-                      page-width page-height)
-              "-dEPSCrop"))
+           ;; ps-page-count returns 0 for EPS files
+           (if (zero? page-count)
+               "-dEPSCrop"
+               (format #f "-dDEVICEWIDTHPOINTS=~,2f -dDEVICEHEIGHTPOINTS=~,2f"
+                       page-width page-height)))
          (cmd (ly:format "~a\
  ~a\
  ~a\