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

PDF images don't convert in GitHub Actions #452

Open
rowanc1 opened this issue Jul 3, 2023 · 5 comments
Open

PDF images don't convert in GitHub Actions #452

rowanc1 opened this issue Jul 3, 2023 · 5 comments

Comments

@rowanc1
Copy link
Member

rowanc1 commented Jul 3, 2023

Need to investigate further on this one!

@jan-david-fischbach
Copy link
Contributor

👍

@jan-david-fischbach
Copy link
Contributor

For reference, this is the error I get:

2023-07-31T13:42:43.9808172Z Could not convert from PDF to PNG: _build/site/public/width_sweep-8bca976875a10bf293f360c1ef6fe9c8.pdf - Error: Command failed: convert -density 600 -colorspace RGB _build/site/public/width_sweep-8bca976875a10bf293f360c1ef6fe9c8.pdf _build/site/public/width_sweep-8bca976875a10bf293f360c1ef6fe9c8.png
2023-07-31T13:42:43.9809205Z convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421.

@jan-david-fischbach
Copy link
Contributor

jan-david-fischbach commented Aug 4, 2023

@rowanc1 Seems to be an issue with imagemagick being very cautious with pdf conversion due to a ghostscript vulnerability: https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion

@jan-david-fischbach
Copy link
Contributor

jan-david-fischbach commented Aug 9, 2023

- run: sudo apt-get update
- run: sudo apt-get -y install ghostscript
- run: sudo sed -i '/domain="coder" rights="none"/d' /etc/ImageMagick-6/policy.xml

This circumvents the bug. We should probably also make sure to install Ghostscript ≥9.24 to avoid the vulnerability

@rowanc1
Copy link
Member Author

rowanc1 commented Aug 10, 2023

Love this, thank you! I think that if we start to make our own action #453, then we could start to incorporate these there for everyone. Right now the myst init --gh-pages puts you off on your own to add these (which can be good, but doesn't allow centralized updates!). There is an action we could start to copy here:
https://github.com/curvenote/action-myst-publish

Ideally a myst build github action that is configurable with PDF etc. (download latex, install packages, don't do it if you don't need to) would be super helpful, and be part of the pages deployment action as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants