Closed bastistician closed 3 years ago
The ubuntu error is completely unrelated. It is expected if you do a --fake
install that you have missing functions.
Ok, this was a bad guess then.
Maybe I should report this failure @gaborcsardi, who maintains the rhub/r-minimal
Alpine image and a list of known failures (which currently doesn't mention magick).
From the error it looks like imagemagick on alpine is missing the logo
demo image.
@jeroen Seems like it is in another package:
~ # apk info -L imagemagick-doc | grep logo
usr/share/doc/ImageMagick-7/images/logo-sm-flop.png
usr/share/doc/ImageMagick-7/images/logo-sm-fx.png
usr/share/doc/ImageMagick-7/images/logo-sm.png
usr/share/doc/ImageMagick-7/images/logo.jpg
usr/share/doc/ImageMagick-7/images/logo.png
But imagemagick does not find it there, it seems.
No it's not a file, it is supposed to be a hardcoded demo image inside libmagick. Maybe they stripped it out somehow.
@dlemstra is it possible that some builds of imagemagick do not have the "logo:"
and "wizard:"
etc images?
It seems to work with imagemagick 6, so instead of imagemagick-dev
, you can use the imagemagick6-dev
Alpine package. Maybe this is an imagemagick 7 thing? Or an Alpine thing.
FWIW, if I do a --no-staged-install
of magick (which succeeds), I can reproduce the error in an R session with:
library("magick")
## Linking to ImageMagick 7.0.11.13
## Enabled features: cairo, fontconfig, freetype, ghostscript, heic, lcms, rsvg, webp, x11
## Disabled features: fftw, pango, raw
logo <- image_read("logo:")
## Error in magick_image_readpath(path, density, depth, strip, defines) :
## R: UnableToOpenBlob 'logo:': No such file or directory @ error/blob.c/OpenBlob/3537
It works on all platforms I have tried, both with IM6 and IM7. It seems like/feature a bug in alpine.
@jeroen I agree.
OTOH, FWIW the delayedAssign
is not helping much, because the code is evaluated at load time, anyway. Maybe that was not your intent?
If you want to evaluate it "on-demand", then you can use an active binding, but you need to create it from .onLoad()
because the packaging tool are not great with active bindings in the package namespace. Something like this works, I think:
dummy <- function() { }
.onLoad <- function(libname, pkgname) {
makeActiveBinding(
"logo",
image_read("logo:"),
environment(dummy)
)
}
On course the simplest would be to use a function, logo()
etc, but that is too late now.
It seems to work with imagemagick 6, so instead of
imagemagick-dev
, you can use theimagemagick6-dev
Alpine package.
Thanks. I can confirm that the legacy release of ImageMagick works for me:
library("magick")
## Linking to ImageMagick 6.9.11.55
## Enabled features: cairo, fontconfig, freetype, ghostscript, lcms, rsvg
## Disabled features: fftw, heic, pango, raw, webp, x11
## Using 4 threads
logo <- image_read("logo:")
logo
## format width height colorspace matte filesize density
## 1 GIF 640 480 sRGB FALSE 28576 72x72
delayedAssign was the intention. This is a demo image for use in examples that is initiated when the package is loaded.
It is also useful to test if the package works, because if the demo image cannot be loaded, something is usually very wrong, and the installation should fail.
OK this seems like a bug in the imagemagick package in alpine. It works fine with imagemagick6 or 7 from homebrew, and also works with imagemagick6-dev
on alpine.
delayedAssign was the intention. This is a demo image for use in examples that is initiated when the package is loaded.
Actually, it is not evaluated at load time, only at test-load time during installation.
@bastistician So you can install the package with --no-test-load
with imagemagick 7, and it will work fine as long as you don't use the demo images:
R -e 'install.packages("magick", INSTALL_opts = "--no-test-load", repos = "https://cloud.r-project.org")'
Just make sure you install both the imagemagick
and imagemagick-dev
Alpine packages.
@bastistician Actually, forget all this, you just need both the imagemagick
and imagemagick-dev
packages, both install time and run time, and then everything works:
installr -d -a "imagemagick imagemagick-dev" -t "curl-dev" magick
@bastistician Actually, forget all this, you just need both the
imagemagick
andimagemagick-dev
packages, both install time and run time, and then everything works:
Yes, thank you, Gábor!
So this seems to be a peculiarity of the imagemagick 7 packaging in Alpine unrelated to magick. Sorry for the noise @jeroen.
(Debian/Ubuntu do not ship version 7 (yet); maybe we will see this issue coming up again when they do...)
I think imagemagick-dev
should always depend on imagemagick
so you can't install one without the other. At least that is how it works in debian/ubuntu.
Installing current magick 2.7.2 on Alpine Linux succeeds with
--no-staged-install
. However, with a standard--staged-install
, I getI get a similar error if I try a
--fake
install on my Ubuntu machine (maybe this helps debugging):To reproduce on Alpine Linux using the current development version of magick: