tools/winlibs.R

if(!file.exists("../windows/libwebp/include/webp/decode.h")){
  unlink("../windows", recursive = TRUE)
  url <- if(grepl("aarch", R.version$platform)){
    "https://github.com/r-windows/bundles/releases/download/libwebp-1.3.2/libwebp-1.3.2-clang-aarch64.tar.xz"
  } else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
    "https://github.com/r-windows/bundles/releases/download/libwebp-1.3.2/libwebp-1.3.2-clang-x86_64.tar.xz"
  }  else if(getRversion() >= "4.2") {
    "https://github.com/r-windows/bundles/releases/download/libwebp-1.3.2/libwebp-1.3.2-ucrt-x86_64.tar.xz"
  } else {
    "https://github.com/rwinlib/webp/archive/v1.3.2.tar.gz"
  }
  download.file(url, basename(url), quiet = TRUE)
  dir.create("../windows", showWarnings = FALSE)
  untar(basename(url), exdir = "../windows", tar = 'internal')
  unlink(basename(url))
  setwd("../windows")
  file.rename(list.files(), 'libwebp')
}

Try the webp package in your browser

Any scripts or data that you put into this service are public.

webp documentation built on Sept. 26, 2023, 5:06 p.m.