Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def grid_desired_size(
grid,
media_info,
width=Config.contact_sheet_width,
horizontal_margin=Config.grid_horizontal_spacing):
"""Computes the size of the images placed on a mxn grid with given fixed width.
Returns (width, height)
"""
desired_width = (width - (grid.x - 1) * horizontal_margin) / grid.x
desired_width = int(math.floor(desired_width))
return media_info.desired_size(width=desired_width)
help="number of pixels spacing captures horizontally",
dest="grid_horizontal_spacing",
type=int,
default=Config.grid_horizontal_spacing)
parser.add_argument(
"--grid-vertical-spacing",
help="number of pixels spacing captures vertically",
dest="grid_vertical_spacing",
type=int,
default=Config.grid_vertical_spacing)
parser.add_argument(
"-w", "--width",
help="width of the generated contact sheet",
dest="vcs_width",
type=int,
default=Config.contact_sheet_width)
parser.add_argument(
"-g", "--grid",
help="display frames on a mxn grid (for example 4x5). The special value zero (as in 2x0 or 0x5 or 0x0) is only allowed when combined with --interval or with --manual. Zero means that the component should be automatically deduced based on other arguments passed.",
dest="grid",
type=mxn_type,
default=Config.grid_size)
parser.add_argument(
"-s", "--num-samples",
help="number of samples",
dest="num_samples",
type=int,
default=None)
parser.add_argument(
"-t", "--show-timestamp",
action="store_true",
help="display timestamp for each frame",