diff options
author | Hendrik Jaeger <git-commit@henk.geekmail.org> | 2020-01-23 17:06:44 +0100 |
---|---|---|
committer | Hendrik Jaeger <git-commit@henk.geekmail.org> | 2020-01-23 17:06:44 +0100 |
commit | a98e13fff116836fcc8ed1c124e96685380a07a9 (patch) | |
tree | c6a7656893d8f3ea65bb19fd4c70d51d4b8846ae |
-rw-r--r-- | .zshrc | 27 | ||||
-rw-r--r-- | README | 1 |
2 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,27 @@ +function henkspngpostproc () { + local resize_by + local img + resize_by="$1" + shift + echo "Creating Directories …" + mkdir --parents resized/pngnqed/optipnged optimized + for img in $* + do + echo "Resizing image …" + convert -resize $resize_by% "$img" "resized/$img" + echo "Running pngnq …" + pngnq -s1 -f -d "resized/pngnqed" -e .png "resized/$img" + echo "Running optipng …" + optipng -force -out "resized/pngnqed/optipnged/$img" "resized/pngnqed/$img" + echo "Moving final image to directory 'optimized' …" + cp --verbose --interactive --target-directory=optimized/ "resized/pngnqed/optipnged/$img" + echo "Removing temporary images …" + #rm --verbose --interactive \ + rm --verbose \ + "resized/$img" \ + "resized/pngnqed/$img" \ + "resized/pngnqed/optipnged/$img" + done + rmdir --parents resized/pngnqed/optipnged +} + @@ -0,0 +1 @@ +Function for zsh (possibly even POSIX-Shells) for resizing and optimizing scanned PNG images |