diff options
author | Hendrik Jaeger <git-commit@henk.geekmail.org> | 2020-02-17 21:11:54 +0100 |
---|---|---|
committer | Hendrik Jaeger <git-commit@henk.geekmail.org> | 2020-02-17 21:12:34 +0100 |
commit | 94dfc97adf15c3c1e6dff5a127637fcd5ff8cf86 (patch) | |
tree | 576ece650cb0fe9f46ef68f4e5401b02daf9e3be /.zsh_functions | |
parent | 2e233b9d57d3710f2e5de13f3fb20b09f6caa0d8 (diff) |
Update png post processing function
Diffstat (limited to '.zsh_functions')
-rw-r--r-- | .zsh_functions | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/.zsh_functions b/.zsh_functions index ae295da..ed0cddc 100644 --- a/.zsh_functions +++ b/.zsh_functions @@ -60,13 +60,26 @@ function henkspngpostproc () { local img resize_by="$1" shift + echo "Creating Directories …" + mkdir --parents resized/pngnqed/optipnged optimized for img in $* do - mkdir -p resized/pngnqed/optipnged - convert -resize $resize_by% $img resized/$img - pngnq -f -d resized/pngnqed -e .png resized/$img - optipng -out resized/pngnqed/optipnged/$img resized/pngnqed/$img + 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 } function with () { |