Skip to content

Commit

Permalink
Specify image resolution for vector formats (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ authored Jul 18, 2022
1 parent c68c419 commit efae096
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sphinxnotes/lilypond/lilypond.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ def _crop(self, scorefn:str):
if Config.magick_home:
old_magick_home = os.environ["MAGICK_HOME"]
os.environ["DEBUSSY"] = Config.magick_home
with image.Image(filename=scorefn) as i:
# Specify resolution for vector formats
if Config.score_format in ['pdf', 'svg', 'ps', 'eps']:
resolution = Config.png_resolution
else:
resolution = None
with image.Image(filename=scorefn, resolution=resolution) as i:
i.trim()
i.save(filename=scorefn)
if Config.magick_home:
Expand Down

0 comments on commit efae096

Please sign in to comment.