diff --git a/R/saveGIF.R b/R/saveGIF.R index f8076366..de708e92 100644 --- a/R/saveGIF.R +++ b/R/saveGIF.R @@ -85,11 +85,9 @@ saveGIF = function( img.fmt = paste(img.name, ani.options('imgnfmt'), '.', file.ext, sep = '') if ((use.dev <- ani.options('use.dev'))){ - if (is.character(ani.options('ani.dev')) && - any(grepl(ani.options('ani.dev'), c("png", "bmp", "jpeg", "tiff")))){ + if ("res" %in% names(formals(ani.dev))){ ani.dev(file.path(tempdir(), img.fmt), width = ani.options('ani.width'), height = ani.options('ani.height'), res = ani.options('ani.res')) - # ,bg = ani.options('ani.bg') } else { ani.dev(file.path(tempdir(), img.fmt), width = ani.options('ani.width'), height = ani.options('ani.height')) diff --git a/R/saveHTML.R b/R/saveHTML.R index 07d2ee0e..14f2f81a 100644 --- a/R/saveHTML.R +++ b/R/saveHTML.R @@ -133,8 +133,7 @@ saveHTML = function( img.fmt = file.path(imgdir, paste(img.name, ani.options('imgnfmt'), '.', ani.type, sep = '')) ani.options(img.fmt = img.fmt) if ((use.dev <- ani.options('use.dev'))) { - if (is.character(ani.options('ani.dev')) && - any(grepl(ani.options('ani.dev'), c("png", "bmp", "jpeg", "tiff")))) { + if ("res" %in% names(formals(ani.dev))){ ani.dev(img.fmt, width = ani.options('ani.width'), height = ani.options('ani.height'), res = ani.options('ani.res')) } else { diff --git a/R/saveVideo.R b/R/saveVideo.R index e9aa4bdf..ca6bb43c 100644 --- a/R/saveVideo.R +++ b/R/saveVideo.R @@ -74,8 +74,7 @@ saveVideo = function( img.fmt = file.path(tempdir(), img.fmt) ani.options(img.fmt = img.fmt) if ((use.dev <- ani.options('use.dev'))) { - if (is.character(ani.options('ani.dev')) && - any(grepl(ani.options('ani.dev'), c("png", "bmp", "jpeg", "tiff")))) { + if ("res" %in% names(formals(ani.dev))){ ani.dev(img.fmt, width = ani.options('ani.width'), height = ani.options('ani.height'), res = ani.options('ani.res')) } else {