简体   繁体   English

无法在 Shinyapps.io 中显示图像

[英]Can't display image in shinyapps.io

Following is the piece of code in shiny.server.以下是shiny.server 中的一段代码。 It works perfectly fine and loads the image in local computer.它工作得很好,并将图像加载到本地计算机中。 But whenever I try to host the app in shinyapps.io server the image doesn't show up.但是每当我尝试在 Shinyapps.io 服务器中托管应用程序时,图像都不会显示。 Please guide what's the problem and how to solve the same?请指导是什么问题以及如何解决相同的问题?

output$tb<-renderUI({
  if(is.null(data()))
    h5("developped by Kinsuk ",tags$img(src='shinysnap.jpg',height=350,width=600))
  else
    tabsetPanel(tabPanel("About File",tableOutput("filedf")),tabPanel("Data",tableOutput("table")),tabPanel("Summary",tableOutput("summ")),tabPanel("Centered Variables",dataTableOutput("MeanC")))

})

Try converting your image file from ".jpg" to ".png".尝试将您的图像文件从“.jpg”转换为“.png”。 It may work.它可能会起作用。 I had similar issue, and I got it resolved by converting jpg image to png format.我有类似的问题,我通过将 jpg 图像转换为 png 格式来解决它。

You might want to double check the spelling of your image name.您可能需要仔细检查图像名称的拼写。

I had an image called (let's say) iMage.jpg, and the path image.jpg.我有一个名为(假设)iMage.jpg 的图像和路径 image.jpg。 Locally it found the correct image (in the www folder), but on shinyapps.io it didn't presumably because it is case sensitive there.它在本地找到了正确的图像(在 www 文件夹中),但在 Shinyapps.io 上它可能没有找到,因为它在那里区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM