How to use the yoga.image.options.DEFAULT_OPTIONS function in yoga

To help you get started, we’ve selected a few yoga examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wanadev / yoga / test / test_image_options.py View on Github external
def test_no_parameter_returns_default_options(self):
        opt = options.normalize_options()

        assert opt is not options.DEFAULT_OPTIONS

        for k, v in options.DEFAULT_OPTIONS.items():
            assert k in opt
            assert opt[k] == v
github wanadev / yoga / yoga / image / cli.py View on Github external
choices=["orig", "auto", "jpeg", "jpg", "png"],
            default=DEFAULT_OPTIONS["output_format"]
            )
    parser.add_argument(
            "--%sresize" % prefix,
            help="resize the image",
            metavar="{orig,,x}",
            type=_type_resize,
            default=DEFAULT_OPTIONS["resize"]
            )
    parser.add_argument(
            "--%sjpeg-quality" % prefix,
            help="JPEG quality if the output format is set to 'jpeg'",
            metavar="0-100",
            type=partial(_type_range, 0, 100),
            default=DEFAULT_OPTIONS["jpeg_quality"]
            )
    parser.add_argument(
            "--%sopacity-threshold" % prefix,
            help="threshold below which a pixel is considered transparent",
            metavar="0-255",
            type=partial(_type_range, 0, 255),
            default=DEFAULT_OPTIONS["opacity_threshold"]
            )