# \donttest{
png_file <- system.file("extimg/example.png", package = "resmush")
# For the example, copy to a temporary file
tmp_png <- tempfile(fileext = ".png")
file.copy(png_file, tmp_png, overwrite = TRUE)
resmush_file(tmp_png)
# Several paths
jpg_file <- system.file("extimg/example.jpg", package = "resmush")
tmp_jpg <- tempfile(fileext = ".jpg")
file.copy(jpg_file, tmp_jpg, overwrite = TRUE)
# Output summary in console
summary <- resmush_file(c(tmp_png, tmp_jpg))
# Similar info in an (invisible) data frame as a result
summary
# Display with png
if (require("png", quietly = TRUE)) {
my_png <- png::readPNG(summary$dest_img[1])
grid::grid.raster(my_png)
}
# With parameters
resmush_file(tmp_jpg)
resmush_file(tmp_jpg, qlty = 10)
# }
Run the code above in your browser using DataLab