Get errors when I include `webp` type figures in rmd document

When I use include_graphics function to include webp figures in the RMarkdown document, I find in the knitting process, there is a warning output file:
However, I just want to knit an HTML document instead of md document.

And I get such an error.

Could not determine mime type for `figure/softmax_eq.webp'
错误: pandoc document conversion failed with error 63

And I find this error happens related to package mime

> library(mime)
> guess_type("figure/shadow-bank01.webp")
[1] "application/octet-stream"

My questions are

  1. Is there any possibility to avoid building. I guess it results in error.
  2. Any tips to include a webp figure? I know Yihui and other advanced R users recommend png or jpg. However, in China, all figure in a WeChat Article is loaded in webp.

Temporally, I solve this problem by changing the output type, from html_document to bookdown::gitbook. But the figures does not display.

And I also try

  1. bookdown::html_document2
  2. bookdown::tufte_html2

they also don't work.

The is needed in the process because it is like that rmarkdown works.
RMD :arrow_right: MD :arrow_right: html using pandoc in the last step.

In order to see if there is a issue, a reprex would be helpful.

Hi @cderv I find it is hard to use reprex when the code on the clipboard includes the render() function.
I get this error.

> reprex(si=T)
Rendering reprex...
Error: pandoc document conversion failed with error 5

Thus, I upload the related document.

  1. the webp fiile,
  2. the rmd file,

The two are in the same directory.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.