From ce09a55db0752021da343788e4a0dbfbaa1d958f Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Thu, 4 Aug 2022 08:02:50 +0530 Subject: addition of picconv and pdfpicconv script --- .scripts/order | 0 .scripts/pdfpicconv | 3 +++ .scripts/pic-conv | 11 +++++++++++ 3 files changed, 14 insertions(+) mode change 100644 => 100755 .scripts/order create mode 100755 .scripts/pdfpicconv create mode 100755 .scripts/pic-conv (limited to '.scripts') diff --git a/.scripts/order b/.scripts/order old mode 100644 new mode 100755 diff --git a/.scripts/pdfpicconv b/.scripts/pdfpicconv new file mode 100755 index 0000000..8b7a551 --- /dev/null +++ b/.scripts/pdfpicconv @@ -0,0 +1,3 @@ +#!/bin/sh +output=$(echo $1 | cut -d. -f1) +pdftoppm -jpeg -r 300 $1 $output.jpg diff --git a/.scripts/pic-conv b/.scripts/pic-conv new file mode 100755 index 0000000..117292e --- /dev/null +++ b/.scripts/pic-conv @@ -0,0 +1,11 @@ +#!/bin/sh +## Simple shellscript to convert png images to jpg and vice versa in a given folder + +if [[ "$1" = "-j" ]]; then + find . -name "*.png" -exec mogrify -format jpg {} \; +elif [[ "$1" = "-p" ]]; then + find . -name "*.jpg" -exec mogrify -format png {} \; +else + echo "Use correct flags!" && exit +fi + -- cgit v1.2.3