# Path: tailor/config.py
# def jpath(*args):
# def reload(path):


import os
import subprocess
from tailor.config import pkConfig
    @staticmethod
    def process(filename, w, h, color0="none", color1="black", ratio=1.5, output=None):
        if output is None:
            output = filename

        cmd = "convert ( {} ) \
               ( -size {}x{} radial-gradient:{}-{} -gravity center \
               -crop {}x{}+0+0 +repage ) \
               -compose multiply -flatten {}".format(
            filename, w, h, color0, color1, w, h, output
        )

        execute(cmd)
        return output


class Toaster:
    @staticmethod
    def process(filename, w, h, output=None):
        if output is None:
            output = filename

        # output = filename + '-toaster.miff'
        scratch = filename + "scratch.miff"

        # colortone
        # scratch = colortone(filename, '#330000', 100, 0, output=scratch)
        # scratch = colortone(filename, '#220000', 100, 0, output=scratch)
        scratch = colortone(filename, "#110000", 105, 0, output=scratch)


# Path: tailor/config.py
# def jpath(*args):
# def reload(path):


# Path: tailor/plugins/composer/filters/old_filters.py
import os
import subprocess
from tailor.config import pkConfig

    @staticmethod
    def process(filename, w, h, color0="none", color1="black", ratio=1.5, output=None):
        if output is None:
            output = filename

        cmd = "convert ( {} ) \
               ( -size {}x{} radial-gradient:{}-{} -gravity center \
               -crop {}x{}+0+0 +repage ) \
               -compose multiply -flatten {}".format(
            filename, w, h, color0, color1, w, h, output
        )

        execute(cmd)
        return output


class Toaster:
    @staticmethod
    def process(filename, w, h, output=None):
        if output is None:
            output = filename

        # output = filename + '-toaster.miff'
        scratch = filename + "scratch.miff"

        # colortone
        # scratch = colortone(filename, '#330000', 100, 0, output=scratch)
        # scratch = colortone(filename, '#220000', 100, 0, output=scratch)
        scratch = colortone(filename, "#110000", 105, 0, output=scratch)


        brightness = pkConfig.get("postprocessing", "brightness")