Skip to content

Adds pre-commit Git hook to run `optipng` on staged images

Rob Nelson requested to merge pull/9137/optipng-hook into Bleeding-Edge

Created by: wwjnc

I could not help but notice your PNGs were not optimized, vgstation13.

People with optipng installed (or in their PATH, whatever) can use this hook to run it automatically on every PNG/DMI staged before committing stuff, so the commits always have almost minimal size.

This needs to be enabled per-user, so you can choose not to opt into the botnet be a coolkid. Moving the pre-commit file to .git/hooks should be enough. I've also included a shell script to automatically install it—and maybe future hooks.

optipng preserves PNG comments so no DMI files shouldwill be exploding around.

Merge request reports