diff options
author | Travis CI <travis@Traviss-Mac.local> | 2020-10-11 20:36:36 +0000 |
---|---|---|
committer | Travis CI <travis@Traviss-Mac.local> | 2020-10-11 20:36:36 +0000 |
commit | 594f5a52ec000ba7fe4a0edccdf99849b3fae520 (patch) | |
tree | ce99ac349613bf8e4236034e5a6515e8ee391240 /scripts/minify-images.sh | |
parent | 5.6.0-nightly.6 and trigger AppVeyor nightly build [skip travisci] (diff) | |
parent | Add vertical style and "Always show workspace drawer" setting (#567) (diff) | |
download | ferdium-app-594f5a52ec000ba7fe4a0edccdf99849b3fae520.tar.gz ferdium-app-594f5a52ec000ba7fe4a0edccdf99849b3fae520.tar.zst ferdium-app-594f5a52ec000ba7fe4a0edccdf99849b3fae520.zip |
Merge remote-tracking branch 'source/develop' into HEAD
Diffstat (limited to 'scripts/minify-images.sh')
-rwxr-xr-x | scripts/minify-images.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/minify-images.sh b/scripts/minify-images.sh new file mode 100755 index 000000000..25a761f0b --- /dev/null +++ b/scripts/minify-images.sh | |||
@@ -0,0 +1,12 @@ | |||
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 | ||
5 | FILES=`find . -name "*.jpg" -o -name "*.jpeg" -o -name "*.bmp" -o -name "*.png" -type f | GREP_OPTIONS= egrep -v "node_modules|internal-server|recipes"` | ||
6 | for file in $FILES; do | ||
7 | echo "Minifying file: $file" | ||
8 | size_before=`/usr/bin/du $file | cut -f1` | ||
9 | npx imagemin $file > $file.tmp && mv $file.tmp $file | ||
10 | size_after=`/usr/bin/du $file | cut -f1` | ||
11 | echo "$size_before -> $size_after" | ||
12 | done | ||