Skip to contents

[Experimental] Wraps filenamr::read_exif(), magick::image_ggplot(), and page_layout() to create contact shets for a folder of images.

Usage

make_contact_sheets(
  images,
  dims = NULL,
  ncol = NULL,
  nrow = NULL,
  captions = "{file_name}\n{date_created}",
  caption_size = 12,
  caption_position = "panel",
  image_margin = margins(0.1, unit = "in"),
  page = "letter",
  orientation = "portrait",
  image_max = NULL,
  image_fileext = NULL,
  tags = NULL,
  tz = NULL,
  save = FALSE,
  filename = NULL,
  ...
)

Arguments

images

File path or data.frame from filenamr::read_exif()

dims

Image dimensions in same dimensions as page. Required.

ncol, nrow

The dimensions of the grid to create. If both are NULL, dims will be used or dims will be determined based on the plot dimensions.

captions

Template for caption, passed to glue::glue_data() using the images data.frame as .x. Note that this template may vary if you are using a custom tags parameter or modify the "filenamr.exif_xwalk" option. See filenamr::read_exif() for more details. Default: "{file_name}\n{date_created}"

caption_size

Caption size, passed to ggplot2::element_text() for plot.caption for theme, Default: 12

caption_position

Caption position, passed to plot.caption.position for theme, Default: 'panel'

image_margin

Image margin passed Default: margins(0.1, unit = "in")

page

Paper name or a data.frame with width and height columns. Optional if width and height are both provided, Default: NULL

orientation

Paper orientation, Optional if width and height are both provided, Default: 'landscape'

image_max

Maximum number of images to use for contact sheets.

image_fileext

Passed to fileext parameter of filenamr::read_exif(), Default: NULL

tags

List of EXIF tags to read from files. If NULL (default), set to option "filenamr.exif_tags" or default default_exif_tags.

tz

Time zone to pass to lubridate::ymd_hms() if format_exif is TRUE. Typically set to Sys.timezone() to convert date/time columns.

save

If TRUE, save contact sheet to a file. filename may be required if save is TRUE. Default: FALSE

filename

File name to create on disk.

...

Additional parameters passed to map_ggsave_ext() excluding width, height, and units.

Value

A list of patchwork object or (if save = TRUE) invisibly return the list and save a file.