Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify image resolution for vector formats #18

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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