diff options
author | Stuart Rackham <srackham@methods.co.nz> | 2012-07-11 09:38:18 +1200 |
---|---|---|
committer | Stuart Rackham <srackham@methods.co.nz> | 2012-07-11 09:38:18 +1200 |
commit | bcb59f2deff638259125a3f5fec9915acdb8bf0d (patch) | |
tree | 30b75cc0bd0c8a9beeb61fadd85b42b945b8e816 | |
parent | 6ecadba26bff510d2a903a376e52977dadc503ee (diff) | |
download | asciidoc-bcb59f2deff638259125a3f5fec9915acdb8bf0d.tar.gz |
music2png: optimize the previous commit (the real solution was -strip not
-monochrome). Bump the version number.
-rwxr-xr-x | filters/music/music2png.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/filters/music/music2png.py b/filters/music/music2png.py index ea6fd26..a0224df 100755 --- a/filters/music/music2png.py +++ b/filters/music/music2png.py @@ -56,7 +56,7 @@ warnings.simplefilter('ignore',DeprecationWarning) import os, sys, tempfile, md5 -VERSION = '0.1.1' +VERSION = '0.1.2' # Globals. verbose = False @@ -140,13 +140,10 @@ def music2png(format, infile, outfile, modified): os.rename(png, outfile) finally: os.chdir(saved_pwd) - # Chop the bottom 75 pixels off to get rid of the page footer. - run('convert "%s" -gravity South -chop 0x75 "%s"' % (outfile, outfile)) - # Trim all blank areas from sides, top and bottom. - # The convert(1) -monochrome +repage options necessary to suppress FOP - # error 'FOPException: Raster ByteInterleavedRaster' (FOP 1.0, Imagemagick - # 6.6.9-7). - run('convert "%s" -trim -monochrome +repage "%s"' % (outfile, outfile)) + # Chop the bottom 75 pixels off to get rid of the page footer then crop the + # music image. The -strip option necessary because FOP does not like the + # custom PNG color profile used by Lilypond. + run('convert "%s" -strip -gravity South -chop 0x75 -trim "%s"' % (outfile, outfile)) for f in temps: if os.path.isfile(f): print_verbose('deleting: %s' % f) |