diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0cc06aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +public +!.gitkeep +cwebp diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..6d589f7 --- /dev/null +++ b/install.sh @@ -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-* diff --git a/run_prepareimg.sh b/run_prepareimg.sh new file mode 100755 index 0000000..0d4f7d9 --- /dev/null +++ b/run_prepareimg.sh @@ -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 \ No newline at end of file