How to use gallerize - 6 common examples

To help you get started, we’ve selected a few gallerize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github homeworkprod / gallerize / test_gallerize.py View on Github external
def test_find_duplicate_filenames(paths, expected):
    actual = dict(find_duplicate_filenames(paths))
    assert actual == expected
github homeworkprod / gallerize / test_gallerize.py View on Github external
def test_parse_dimension_arg(arg_value, expected_width, expected_height):
    actual = parse_dimension_arg(arg_value)

    assert actual.width == expected_width
    assert actual.height == expected_height
github homeworkprod / gallerize / test_gallerize.py View on Github external
def test_window(iterable, n, expected):
    actual = list(window(iterable, n))
    assert actual == expected
github homeworkprod / gallerize / gallerize.py View on Github external
d = defaultdict(list)
    for path in paths:
        key = os.path.basename(path).lower()
        d[key].append(path)

    return filter(lambda x: len(x[1]) > 1, d.items())


# -------------------------------------------------------------------- #


if __name__ == '__main__':
    try:
        args = parse_args()
        handle_duplicate_filenames(args.full_image_filenames)
        Gallery.from_args(args).generate()
    except KeyboardInterrupt:
        sys.exit('Ctrl-C pressed, aborting.')
github homeworkprod / gallerize / gallerize.py View on Github external
def from_args(cls, args):
        gallery = Gallery()

        gallery.images = [Image(gallery, image)
                          for image in sorted(args.full_image_filenames)]
        gallery.link_images()
        gallery.title = args.title
        gallery.destination_path = args.destination_path
        gallery.resize = not args.no_resize
        gallery.max_image_size = args.max_image_size
        gallery.max_thumbnail_size = args.max_thumbnail_size

        return gallery
github homeworkprod / gallerize / gallerize.py View on Github external
def from_args(cls, args):
        gallery = Gallery()

        gallery.images = [Image(gallery, image)
                          for image in sorted(args.full_image_filenames)]
        gallery.link_images()
        gallery.title = args.title
        gallery.destination_path = args.destination_path
        gallery.resize = not args.no_resize
        gallery.max_image_size = args.max_image_size
        gallery.max_thumbnail_size = args.max_thumbnail_size

        return gallery

gallerize

Create a static HTML/CSS image gallery from a bunch of images.

GPL-3.0
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis