0

I am currently trying to host my RShiny app and am running into a problem:

"Warning: Error in magick_image_readpath: R: unable to open image '02-Backrounds/1F602.png' No such file or directory @ error/blob.c/OpenBlob/2924"

The Magick page tells me that it can't find the specified directory - spelled correctly, of course. I have of course tried various things, but became particularly puzzled when I noticed that the SAME R function finds the SAME directory in a different place and is able to load the corresponding images.

Do any of you have an idea why R can find and call the directory in one place, but throws an error in another?

You will find some code at the end - but to make it reproducible, I would have to post my whole order structure with several files - maybe someone will notice something with just the code snippets.

For your information: I publish the app via Docker and ShinyProxy :)


The following code for the result:

Hintergrundbild <- paste("02-Backgrounds/XXX", TagWoche, sep ="_")
Hintergrund <-
    image_read(paste(Hintergrundbild, ".png", sep = "")) %>%
    image_resize("1748x2480!")

The following code does NOT lead to the result:

Emoji1 <- image_read(paste("02-Backgrounds/", DatenEmojiplot$hex_runes1[1], ".png", sep = ""))
  Emoji2 <- image_read(paste("02-Backgrounds/", DatenEmojiplot$hex_runes1[2], ".png", sep = ""))

I deliberately put everything in the folder that is found in principle - unfortunately without success.

At the end I "paint" the variables with cowplot

Ausgabe <- ggdraw() +
      draw_image(Hintergrund) +
      draw_image(Emoji1, x = -0.46, y=-0.202, width = 1.1, height = 1, scale = 0.015)+
      draw_image(Emoji2, x = -0.46, y=-0.235, width = 1.1, height = 1, scale = 0.015)
LePyka
  • 181
  • 8
  • Your paths are all **relative** to the current directory, which may have changed between two functions. You could try using absolute paths just to test, i.e. something like `/Users/LePyka/Bilder...` – Mark Setchell Sep 24 '21 at 07:12
  • @MarkSetchell i tried it with absolut paths but i guess due to the docker structure (?) thats not possible. If i try to refer to the root/app/backrounds folder i get the error "permission denied" or similar and till now i did not figure out how to grant access-rights to the docker or whatever (tbh i did not understand docker 100% as u might notice :D) – LePyka Sep 24 '21 at 13:37

0 Answers0