diff --git a/R/images.R b/R/images.R index 1c2cc52..d6bbd2b 100644 --- a/R/images.R +++ b/R/images.R @@ -255,7 +255,7 @@ pdf_image_icc_profile <- function(obj) { #' fixture <- system.file("extdata", "fixtures", "image.pdf", #' package = "pdfium" #' ) -#' if (nzchar(fixture)) { +#' if (nzchar(fixture) && requireNamespace("png", quietly = TRUE)) { #' doc <- pdf_doc_open(fixture) #' page <- pdf_page_load(doc, 1L) #' imgs <- Filter(function(o) o$type == "image", pdf_page_objects(page)) diff --git a/man/pdf_image_extract.Rd b/man/pdf_image_extract.Rd index f8a6a04..d6afe3e 100644 --- a/man/pdf_image_extract.Rd +++ b/man/pdf_image_extract.Rd @@ -41,7 +41,7 @@ Mirrors pypdfium2's \code{PdfImage.extract()} convenience. fixture <- system.file("extdata", "fixtures", "image.pdf", package = "pdfium" ) -if (nzchar(fixture)) { +if (nzchar(fixture) && requireNamespace("png", quietly = TRUE)) { doc <- pdf_doc_open(fixture) page <- pdf_page_load(doc, 1L) imgs <- Filter(function(o) o$type == "image", pdf_page_objects(page))