aboutsummaryrefslogtreecommitdiffstats
path: root/minify-images.sh
diff options
context:
space:
mode:
authorLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2020-10-09 19:20:03 +0530
committerLibravatar GitHub <noreply@github.com>2020-10-09 14:50:03 +0100
commit5f7d8ebe6d8a9a9e5a1b4e9f041ece1a7ae38ab1 (patch)
treecdc425c4133df2da78c3e3dfcf1b25825a2871dd /minify-images.sh
parentAdd recipe for Disqus (#322) (diff)
downloadferdium-recipes-5f7d8ebe6d8a9a9e5a1b4e9f041ece1a7ae38ab1.tar.gz
ferdium-recipes-5f7d8ebe6d8a9a9e5a1b4e9f041ece1a7ae38ab1.tar.zst
ferdium-recipes-5f7d8ebe6d8a9a9e5a1b4e9f041ece1a7ae38ab1.zip
Use imagemin to minify images (#323)
Diffstat (limited to 'minify-images.sh')
-rwxr-xr-xminify-images.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/minify-images.sh b/minify-images.sh
new file mode 100755
index 0000000..e9c804c
--- /dev/null
+++ b/minify-images.sh
@@ -0,0 +1,9 @@
1#!/usr/bin/env sh
2
3# Note: This script is needed due to this bug: https://github.com/imagemin/imagemin/issues/348
4# once the above is fixed, we should simply be able to specify the input directory where all image files are to be processed recursively
5FILES=`find . -name "*.jpg" -o -name "*.jpeg" -o -name "*.bmp" -o -name "*.png" -type f | GREP_OPTIONS= egrep -v "node_modules"`
6for file in $FILES; do
7 echo "Minifying file: $file"
8 npx imagemin $file > $file
9done