Skip to content

Commit

Permalink
enahnce: replace inkscape with librsvg
Browse files Browse the repository at this point in the history
  • Loading branch information
ublefo committed May 2, 2024
1 parent 96351e8 commit 490fdb5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apt-get update \
wget \
redis \
libc6-dev \
inkscape \
librsvg2-bin \
docker-ce \
docker-ce-cli \
containerd.io \
Expand Down
5 changes: 2 additions & 3 deletions app/views/layouts/jupynotex.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ def process_svg(self, image_data):
with open(svg_fname, 'wb') as fh:
fh.write(raw_svg)

with open(os.devnull, 'w') as null:
cmd = ['inkscape', '--export-text-to-path', '--export-filename={}'.format(pdf_fname), svg_fname]
subprocess.run(cmd, stderr=null)
cmd = ['rsvg-convert', '--format=pdf', '--output={}'.format(pdf_fname), svg_fname]
subprocess.run(cmd)

return pdf_fname

Expand Down
2 changes: 1 addition & 1 deletion deployAppSvr.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN apt-get update \
cron \
msmtp-mta bsd-mailx \
redis \
inkscape \
librsvg2-bin \
docker-ce \
docker-ce-cli \
containerd.io \
Expand Down

0 comments on commit 490fdb5

Please sign in to comment.