Exemplo n.º 1
0
 def topic(self):
     FILTERS_AVAILABLE_BAK = PIL.FILTERS_AVAILABLE
     PIL.FILTERS_AVAILABLE = False
     engine = PIL.Engine(None)
     try:
         return engine.paste(None, None, True)
     finally:
         PIL.FILTERS_AVAILABLE = FILTERS_AVAILABLE_BAK
Exemplo n.º 2
0
        def topic(self):
            config = Config()
            server = ServerParameters(8889, 'localhost', 'thumbor.conf', None,
                                      'info', None)

            context = Context(server, config, Importer(config))

            with open("%s/quantization.jpg" % FIXTURES_FOLDER, "rb") as f:
                buffer = f.read()

            engine = PIL.Engine(context=context)
            engine.load(buffer, '.jpg')

            return engine
Exemplo n.º 3
0
        def topic(self):
            config = Config()
            server = ServerParameters(8889, 'localhost', 'thumbor.conf', None,
                                      'info', None)
            config.PILLOW_JPEG_SUBSAMPLING = 2
            config.PILLOW_JPEG_QTABLES = 'web_high'
            context = Context(server, config, Importer(config))

            with open("%s/quantization.jpg" % FIXTURES_FOLDER, "rb") as f:
                buffer = f.read()

            engine = PIL.Engine(context=context)
            engine.load(buffer, '.jpg')
            engine.read('.jpg', None)

            return engine.image
Exemplo n.º 4
0
 def topic(self):
     engine = PIL.Engine(None)
     engine.image = MockImage('P', 640, 480)
     engine.resize(320, 240)
     return engine.image
Exemplo n.º 5
0
 def topic(self):
     engine = PIL.Engine(None)
     engine.image = MockImage('other', 640, 480)
     engine.resize(160, 120)
     return engine.image
Exemplo n.º 6
0
 def topic(self):
     PIL.FILTERS_AVAILABLE = False
     engine = PIL.Engine(None)
     return engine.paste(None, None, True)