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="do not capture frames in the first and last n percent of total time",
dest="delay_percent",
type=int,
default=Config.delay_percent)
parser.add_argument(
"--grid-spacing",
help="number of pixels spacing captures both vertically and horizontally",
dest="grid_spacing",
type=int,
default=Config.grid_spacing)
parser.add_argument(
"--grid-horizontal-spacing",
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",