ropensci / magick

Magic, madness, heaven, sin
https://docs.ropensci.org/magick
Other
461 stars 65 forks source link

Robust HEIC support #377

Closed dcaud closed 1 year ago

dcaud commented 1 year ago

I'm trying to read HEIC files in an R Shiny app on shinyapps.io with something like:

image_read("sample-heic-file.heic")

but I get this:

Warning: Error in eval: R: no decode delegate for this image format `HEIC' @ error/constitute.c/ReadImage/572

Someone else had the same problem.

And this issue suggests that the issue may have to do with compability with Ubuntu. My code works on my Mac, but not on shinyapps.io.

Any idea for a fix to make reading this file format robust to environment?

jeroen commented 1 year ago

Afaict heif should be supported in the latest ubuntu 22.04 LTS. I'm not sure what version shinyapps.io is on these days.

There is nothing we can do to fix this for you, the version of imagemagick and supported driver libraries are determined by your operating system. They'll need to update your version of ubuntu that supports heif.

dcaud commented 1 year ago

Thanks. It looks like shinyapps.io uses Ubuntu 20.04 (at least as of 2 years ago: https://community.rstudio.com/t/newly-deployed-applications-on-shinyapps-io-now-use-ubuntu-20-04/100545). I have written to ask if they can add whatever is needed -- Do you know if there is one or two specific libraries that would make this viable on Ubuntu 20.04? That may be an easier request than having them update to 22.04.

jeroen commented 1 year ago

Based on the ubuntu details from https://packages.ubuntu.com/source/jammy/imagemagick the first version to have libheif is imagemagick 6.9.11.

I can only recommend to open an issue in https://github.com/rstudio/shinyapps-package-dependencies/issues to request imagemagick 6.9.11. This will automatically happen once they bump to ubuntu 22.04.

Sorry there is not much else I can do.