diff options
author | Matthew Peveler <matt.peveler@gmail.com> | 2021-10-17 08:27:13 -1000 |
---|---|---|
committer | Matthew Peveler <matt.peveler@gmail.com> | 2021-10-17 08:32:16 -1000 |
commit | 0054f5ee9dcf0c2b0765cca22fc00fc8b9bb6e2e (patch) | |
tree | 4a64e6815b541b3110df9da2480d286f8406d570 | |
parent | 4667219e473a24e8e645eb9b9fb0a7ddba322f44 (diff) | |
download | asciidoc-py3-mpeveler/bugfix-music-gm.tar.gz |
Reset gravity before using trim on convertmpeveler/bugfix-music-gm
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
-rwxr-xr-x | asciidoc/resources/filters/music/music2png.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/asciidoc/resources/filters/music/music2png.py b/asciidoc/resources/filters/music/music2png.py index c758b4c..a7f0f3c 100755 --- a/asciidoc/resources/filters/music/music2png.py +++ b/asciidoc/resources/filters/music/music2png.py @@ -151,7 +151,13 @@ def music2png(format, infile, outfile, modified): # 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)) + # We reset the +gravity before running -trim to avoid a bug in GraphicsMagick. + run( + 'convert "%s" -strip -gravity South -chop 0x75 +gravity -trim "%s"' % ( + outfile, + outfile + ) + ) for f in temps: if os.path.isfile(f): print_verbose('deleting: %s' % f) |