diff options
author | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-07-23 21:03:34 +0200 |
---|---|---|
committer | Hendrik Jäger <gitcommit@henk.geekmail.org> | 2022-07-23 21:07:31 +0200 |
commit | fa212b3b9a87fd17980d78a5e2e4fb925617edf8 (patch) | |
tree | a55d0e5c52e9ca8f2181270e954b7171e552bab6 /.zsh_functions/henkspngpostproc | |
parent | 9cff6202ab4fb740f072b0d3323aaa4709e38cf7 (diff) |
also create pdf from png
Diffstat (limited to '.zsh_functions/henkspngpostproc')
-rw-r--r-- | .zsh_functions/henkspngpostproc | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/.zsh_functions/henkspngpostproc b/.zsh_functions/henkspngpostproc index 8260b1e..c35650d 100644 --- a/.zsh_functions/henkspngpostproc +++ b/.zsh_functions/henkspngpostproc @@ -1,24 +1,25 @@ - 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 +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" + img2pdf --output $(basename $img .png).pdf optimized/${img} +done +rmdir --parents resized/pngnqed/optipnged |