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

Enable image magick ghostscript features #289

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ touch packages/[r_package_name]/test.R

```bash
make test-xenial-[r_package_name]
make test-bionic-[r_package_name]
make test-focal-[r_package_name]
```
9 changes: 9 additions & 0 deletions packages/magick/install
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ if [ ${OS_CODENAME} == "xenial" ]; then
fi

apt-get install -y libmagick++-dev


if [ ${OS_CODENAME} == "focal" ]; then
# Enable imagemagick ghostscript features
# See https://www.kb.cert.org/vuls/id/332928/
# focal has a new enough version of ghostscript
sed -i "\$i \ \ <policy domain=\"coder\" rights=\"read | write\" pattern=\"{PS,PS2,PS3,EPS,PDF,XPS}\" />" /etc/ImageMagick-6/policy.xml
fi

8 changes: 8 additions & 0 deletions packages/magick/test.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ install.packages("magick", repos = "https://cran.rstudio.com")
library(magick)
docdir <- Sys.getenv("R_DOC_DIR", R.home("doc"))
img <- magick::image_read(file.path(docdir, "html", "logo.jpg"))

# Create a pdf
image_write(wizard,
tempfile(pattern = "pdftemp", fileext = '.pdf'),
density = 55,
format = 'pdf',
comment = "Edit PDFs and Images"
)