Skip to content

UnknownPlatypus/jpegoptim-py

Repository files navigation

build status

jpegoptim-py

A python wrapper to provide a pip-installable jpegoptim binary.

Internally this package provides a convenient way to download the pre-built jpegoptim binary for your particular platform.

Installation

pip install jpegoptim-py

Usage

After installation, the jpegoptim binary should be available in your environment (or jpegoptim.exe on windows).

As a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/UnknownPlatypus/jpegoptim-py
    rev: v1.5.5.2
    hooks:
    -   id: jpegoptim

Lossy compression is not idempotent. In that case, consider adding a threshold, otherwise you might block the commit for too long.

Sample .pre-commit-config.yaml with lossy compression enabled:

-   repo: https://github.com/UnknownPlatypus/jpegoptim-py
    rev: v1.5.5.2
    hooks:
    -   id: jpegoptim
        args: [--strip-all, --all-progressive, --max=85, --threshold=3]

References

This is an adaptation of shellcheck-py following the exact same strategy. This aims at making it easier to use as a pre-commit hook.

About

Python wrapper for installing jpegoptim

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages