Пример #1
0
def test_generate_thumbnail(tmpdir, image, path, wide_size, high_size):
    "Test the generate_thumbnail function."

    dstfile = str(tmpdir.join(image))
    for size in [(200, 150), (150, 200)]:
        generate_thumbnail(path, dstfile, size)
        im = PILImage.open(dstfile)
        assert im.size == size

    for size, thumb_size in [((200, 150), wide_size), ((150, 200), high_size)]:
        generate_thumbnail(path, dstfile, size, fit=False)
        im = PILImage.open(dstfile)
        assert im.size == thumb_size
Пример #2
0
def test_generate_thumbnail(tmpdir):
    "Test the generate_thumbnail function."

    dstfile = str(tmpdir.join(TEST_IMAGE))
    for size in [(200, 150), (150, 200)]:
        generate_thumbnail(SRCFILE, dstfile, size)
        im = Image.open(dstfile)
        assert im.size == size

    for size, thumb_size in [((200, 150), (185, 150)), ((150, 200), (150, 122))]:
        generate_thumbnail(SRCFILE, dstfile, size, fit=False)
        im = Image.open(dstfile)
        assert im.size == thumb_size
Пример #3
0
def test_generate_thumbnail(tmpdir, image, path, wide_size, high_size):
    "Test the generate_thumbnail function."

    dstfile = str(tmpdir.join(image))
    for size in [(200, 150), (150, 200)]:
        generate_thumbnail(path, dstfile, size)
        im = Image.open(dstfile)
        assert im.size == size

    for size, thumb_size in [((200, 150), wide_size),
                             ((150, 200), high_size)]:
        generate_thumbnail(path, dstfile, size, fit=False)
        im = Image.open(dstfile)
        assert im.size == thumb_size
Пример #4
0
def test_generate_thumbnail(tmpdir):
    "Test the generate_thumbnail function."

    dstfile = str(tmpdir.join(TEST_IMAGE))
    for size in [(200, 150), (150, 200)]:
        generate_thumbnail(SRCFILE, dstfile, size)
        im = Image.open(dstfile)
        assert im.size == size

    for size, thumb_size in [((200, 150), (185, 150)),
                             ((150, 200), (150, 122))]:
        generate_thumbnail(SRCFILE, dstfile, size, fit=False)
        im = Image.open(dstfile)
        assert im.size == thumb_size