Skip to content

Commit ff8a806

Browse files
committed
Remove unused functions
1 parent dc5f0e7 commit ff8a806

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

R/utils.R

-26
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22
#' @export
33
magrittr::`%>%`
44

5-
read_path <- function(path){
6-
image <- if(is.character(path)){
7-
if(is_url(path)){
8-
read_url(path)
9-
} else {
10-
read_file(path)
11-
}
12-
} else if(is.raw(path)){
13-
path
14-
} else {
15-
stop("Parameter 'image' must be an image object, file path or raw vector with image data")
16-
}
17-
return(image)
18-
}
19-
205
is_url <- function(path){
216
grepl("^https?://", path)
227
}
@@ -59,17 +44,6 @@ download_url <- function(url){
5944
return(filename)
6045
}
6146

62-
read_url <- function(path){
63-
req <- curl::curl_fetch_memory(path)
64-
if(req$status_code >= 400)
65-
stop(sprintf("Failed to download %s (HTTP %d)", path, req$status))
66-
return(req$content)
67-
}
68-
69-
read_file <- function(path){
70-
readBin(normalizePath(path, mustWork = TRUE), raw(), file.info(path)$size)
71-
}
72-
7347
assert_image <- function(image){
7448
if(!inherits(image, "magick-image"))
7549
stop("The 'image' argument is not a magick image object.", call. = FALSE)

0 commit comments

Comments
 (0)