Added script

This commit is contained in:
DrMint 2022-02-19 05:19:46 +01:00
parent 308ba0f49b
commit cdea419a02
3 changed files with 20 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
public
!.gitkeep
cwebp

4
install.sh Executable file
View File

@ -0,0 +1,4 @@
wget https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2-rc1-linux-x86-64.tar.gz
tar -xf *.tar.gz
mv libwebp-*/bin/cwebp .
rm -r libwebp-*

13
run_prepareimg.sh Executable file
View File

@ -0,0 +1,13 @@
mkdir public
mkdir public/small
mkdir public/medium
mkdir public/large
echo "Working on large images"
for f in ../strapi.accords-library.com/public/uploads/*; do
filename=$(basename "$f")
./cwebp -short -m 6 -q 80 -alpha_q 80 -mt -resize 0 2048 $f -o public/large/${filename%.*}.webp
done