No known key found for this signature in database
GPG Key ID: 1D7529BE14E2BBA9
3 changed files with
3 additions and
3 deletions
-
DESCRIPTION
-
R/get-content-type.R
-
R/guess-content-type.R
|
|
@ -14,7 +14,7 @@ Description: MIME types are shorthand descriptors for |
|
|
|
perform curated "magic" tests as well as mapping |
|
|
|
MIME types from a database of over 1,800 |
|
|
|
extension mappings. |
|
|
|
URL: http://gitlab.com/hrbrmstr/wand |
|
|
|
URL: https://gitlab.com/hrbrmstr/wand |
|
|
|
BugReports: https://gitlab.com/hrbrmstr/wand/issues |
|
|
|
Encoding: UTF-8 |
|
|
|
License: MIT + file LICENSE |
|
|
|
|
|
@ -17,7 +17,7 @@ |
|
|
|
#' get_content_type(system.file("extdat", "test.pdf", package="wand")) |
|
|
|
get_content_type <- function(path, ...) { |
|
|
|
|
|
|
|
path <- path.expand(path) |
|
|
|
path <- path.expand(path[1]) |
|
|
|
if (!file.exists(path)) stop("File not found.", call.=FALSE) |
|
|
|
|
|
|
|
hdr <- readBin(path, "raw", n=1024) |
|
|
|
|
|
@ -19,7 +19,7 @@ |
|
|
|
#' guess_content_type(system.file("extdat", "test.pdf", package="wand")) |
|
|
|
guess_content_type <- function(path, not_found = "???", custom_db = NULL) { |
|
|
|
|
|
|
|
path <- path.expand(path) |
|
|
|
path <- path.expand(path[1]) |
|
|
|
if (!file.exists(path)) stop("File not found.", call.=FALSE) |
|
|
|
|
|
|
|
if (is.null(custom_db)) { |
|
|
|