R/read.R

Defines functions readPNG

Documented in readPNG

readPNG <- function(source, native=FALSE, info=FALSE)
  if (info) { ## extra processing to interpret R.metadata
    if (!is.raw(source)) source <- path.expand(source)
    x <- .Call(read_png, source, native, TRUE)
    txt <- attr(x, "info")$text
    if ("R.metadata" %in% names(txt)) {
      attr(x, "metadata") <- unserialize(charToRaw(txt["R.metadata"]))
      attr(x, "info")$text <- txt[-which(names(txt) == "R.metadata")]
    }
    x
  } else .Call(read_png, if (is.raw(source)) source else path.expand(source), native, FALSE)

Try the png package in your browser

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

png documentation built on May 1, 2019, 7:28 p.m.