Skip to content

Commit

Permalink
Fixed devtools::check() warning in ThinText.R
Browse files Browse the repository at this point in the history
- Deleted library call of magick
- Added magick:: before image_read and image_write
  • Loading branch information
stephaniereinders committed Aug 18, 2023
1 parent e0d0a20 commit 9a70789
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions R/ThinText.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
#' @export
readPNGBinary = function(path, cutoffAdjust = 0, clean = TRUE, crop = TRUE, inversion = FALSE)
{
library(magick)
message(paste0('path in readPNGBinary: ', path))
if(endsWith(path, "RData") || endsWith(path, "rda")){
load(path)

f <- file.path(tempdir(), "temp_png")
magick_img <- image_read(magick_image)
magick_img <- magick::image_read(magick_image)

image_write(magick_img, path = f, format = "png")
magick::image_write(magick_img, path = f, format = "png")
img = png::readPNG(f)

}else{
Expand Down

0 comments on commit 9a70789

Please sign in to comment.