Skip to content

ggsave(): Optionally switch between ragg and grDevices #4501

@hsbadr

Description

@hsbadr

Currently, ragg doesn't catch segmentation faults due to invalid res, width, height, units, ... etc. (see r-lib/ragg#82). So, would it make sense to add sanity checks before calling the device or give an option to switch between ragg and grDevices by default (without specifying the device argument), even if ragg is available?

ggplot2/R/save.r

Lines 180 to 188 in 6d94f0d

if (requireNamespace('ragg', quietly = TRUE)) {
png_dev <- ragg::agg_png
jpeg_dev <- ragg::agg_jpeg
tiff_dev <- ragg::agg_tiff
} else {
png_dev <- grDevices::png
jpeg_dev <- grDevices::jpeg
tiff_dev <- grDevices::tiff
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions