def test_can_set_resampling_filter(self): to_test = { "LANCZOS": Image.LANCZOS, "NEAREST": Image.NEAREST, "BiLinear": Image.BILINEAR, "bicubic": Image.BICUBIC, "garbage": Image.LANCZOS, } if hasattr(Image, "HAMMING"): to_test["HAMMING"] = Image.HAMMING for setting, expected in to_test.items(): cfg = Config(PILLOW_RESAMPLING_FILTER=setting) engine = Engine(Context(config=cfg)) expect(engine.get_resize_filter()).to_equal(expected) cfg = Config() engine = Engine(Context(config=cfg)) expect(engine.get_resize_filter()).to_equal(Image.LANCZOS)
def test_can_set_resampling_filter(self): to_test = { 'LANCZOS': Image.LANCZOS, 'NEAREST': Image.NEAREST, 'BiLinear': Image.BILINEAR, 'bicubic': Image.BICUBIC, 'garbage': Image.LANCZOS, } if hasattr(Image, 'HAMMING'): to_test['HAMMING'] = Image.HAMMING for setting, expected in to_test.items(): cfg = Config(PILLOW_RESAMPLING_FILTER=setting) engine = Engine(Context(config=cfg)) expect(engine.get_resize_filter()).to_equal(expected) cfg = Config() engine = Engine(Context(config=cfg)) expect(engine.get_resize_filter()).to_equal(Image.LANCZOS)