예제 #1
0
    def get_optimizer(self):
        conf = Config()
        conf.STATSD_HOST = ''
        conf.JPEGTRAN_PATH = which('jpegtran')
        ctx = Context(config=conf)
        optimizer = Optimizer(ctx)

        return optimizer
예제 #2
0
    def get_optimizer(self):
        conf = Config()
        conf.STATSD_HOST = ''
        conf.JPEGTRAN_PATH = which('jpegtran')
        ctx = Context(config=conf)
        optimizer = Optimizer(ctx)

        return optimizer
예제 #3
0
    def get_optimizer(self, filters=None, progressive=False):
        conf = Config()
        conf.STATSD_HOST = ''
        conf.JPEGTRAN_PATH = '/somewhere/jpegtran'
        conf.PROGRESSIVE_JPEG = progressive
        req = RequestParameters(filters=filters)
        ctx = Context(config=conf)
        ctx.request = req
        optimizer = Optimizer(ctx)

        return optimizer
예제 #4
0
    def get_optimizer(self, filters=None, progressive=False):
        conf = Config()
        conf.STATSD_HOST = ''
        conf.JPEGTRAN_PATH = '/somewhere/jpegtran'
        conf.PROGRESSIVE_JPEG = progressive
        req = RequestParameters(filters=filters)
        ctx = Context(config=conf)
        ctx.request = req
        optimizer = Optimizer(ctx)

        return optimizer
예제 #5
0
    def get_optimizer(filters=None, progressive=False, scans_file=""):
        conf = Config()
        conf.STATSD_HOST = ""
        conf.JPEGTRAN_PATH = "/somewhere/jpegtran"
        conf.PROGRESSIVE_JPEG = progressive
        conf.JPEGTRAN_SCANS_FILE = scans_file
        req = RequestParameters(filters=filters)
        ctx = Context(config=conf)
        ctx.request = req
        optimizer = Optimizer(ctx)

        return optimizer
예제 #6
0
    def get_context(self):
        cfg = Config(SECURITY_KEY="ACME-SEC")
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = self.loader_path
        cfg.JPEGTRAN_PATH = which("jpegtran")
        cfg.PROGRESSIVE_JPEG = True
        cfg.OPTIMIZERS = ["thumbor.optimizers.jpegtran"]

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, "localhost", "thumbor.conf", None, "info", None)
        server.security_key = "ACME-SEC"
        ctx = Context(server, cfg, importer)
        return ctx
예제 #7
0
    def get_context(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = self.loader_path
        cfg.JPEGTRAN_PATH = which('jpegtran')
        cfg.PROGRESSIVE_JPEG = True
        cfg.OPTIMIZERS = [
            'thumbor.optimizers.jpegtran',
        ]

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
        server.security_key = 'ACME-SEC'
        ctx = Context(server, cfg, importer)
        return ctx
예제 #8
0
    def get_context(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = self.loader_path
        cfg.JPEGTRAN_PATH = which('jpegtran')
        cfg.PROGRESSIVE_JPEG = True,
        cfg.RESULT_STORAGE_STORES_UNSAFE = True,
        cfg.OPTIMIZERS = [
            'thumbor.optimizers.jpegtran',
        ]

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
        server.security_key = 'ACME-SEC'
        ctx = Context(server, cfg, importer)
        return ctx
예제 #9
0
    def get_context(self):
        cfg = Config(SECURITY_KEY="ACME-SEC")
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = self.loader_path
        cfg.JPEGTRAN_PATH = which("jpegtran")
        cfg.PROGRESSIVE_JPEG = (True,)
        cfg.RESULT_STORAGE_STORES_UNSAFE = (True,)
        cfg.OPTIMIZERS = [
            "thumbor.optimizers.jpegtran",
        ]

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(
            8889, "localhost", "thumbor.conf", None, "info", None
        )
        server.security_key = "ACME-SEC"
        ctx = Context(server, cfg, importer)
        return ctx