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

Switch from external ImageMagick/GraphicsMagick programs to magick package #30

Open
wch opened this issue Sep 22, 2016 · 4 comments
Open

Comments

@wch
Copy link
Owner

wch commented Sep 22, 2016

No description provided.

@maelle
Copy link

maelle commented Mar 22, 2018

I was also wondering whether you'd consider returning a magick image object instead of saving the screenshot to disk.

I tend to use this wrapper

magick_webshot <- function(...){
  path <- paste0(tempfile(), ".png")
  webshot::webshot(..., file = path)
  webshot <- magick::image_read(path)
  file.remove(path)
  webshot
}

This way I can render the screenshot directly in an RMarkdown document. This was inspired by the rtweet::tweet_shot function that actually uses webshot.

@wch
Copy link
Owner Author

wch commented Mar 22, 2018

@maelle That does sound useful. It could be an option to webshot(), instead of a new function.

@wch
Copy link
Owner Author

wch commented Mar 23, 2018

Also, using webshot() in an Rmarkdown document should just work. That's how it's done in the vignette.

Source:
https://raw.githubusercontent.com/wch/webshot/master/vignettes/intro.Rmd

And the result:
https://cran.r-project.org/web/packages/webshot/vignettes/intro.html

@maelle
Copy link

maelle commented Mar 23, 2018

ooooh I had no idea sorry! 🙈 Thanks!

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