wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
704 stars 84 forks source link

support request: required magick's features #114

Closed julou closed 5 years ago

julou commented 5 years ago

Hi, I'm trying to use cowplot's draw_image() on our cluster where magick is installed with a limited set of features:

> library(magick)
Linking to ImageMagick 6.9.3.3
Enabled features: fontconfig, freetype, fftw, x11
Disabled features: cairo, ghostscript, lcms, pango, rsvg, webp

Unfortunately ggdraw() + draw_image(magick::image_read_pdf("myfig.pdf")) returns the following error which doesn't happen on macOS:

Error in magick_image_write_frame(image, format = format, i = i) : 
  Dimensions do not add up, 'rgba' may not be a raw format

I'm happy to try enabling the relevant feature, but I'm not sure which one it is… Thank you in advance for your help.

julou commented 5 years ago

or maybe I'm mistaken and magick isn't the issue here…

clauswilke commented 5 years ago

I doubt this has anything to do with cowplot. Try the following three lines and see if they create different output on the different machines. If they do, you know the problem lies with magick.

img <- magick::image_read_pdf("myfig.pdf")
img
plot(img)

In particular, since ghostscript is disabled on your system, I think it's expected that magick can't read pdf files.