Created
August 8, 2019 22:12
-
-
Save innermond/e350f58cb3ddc6933e882078874ee372 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf optimized/** | |
mkdir -p optimized/400w | |
convert unoptimized/*.jpg -sampling-factor 4:2:0 -strip -quality 80 -interlace JPEG -colorspace sRGB -set filename:base "%[base]" -resize 700x -sigmoidal-contrast 5,50% optimized/"%[filename:base].jpg" | |
convert unoptimized/*.jpg -sampling-factor 4:2:0 -strip -quality 80 -interlace JPEG -colorspace sRGB -set filename:base "%[base]" -resize 400x -sigmoidal-contrast 5,50% optimized/400w/"%[filename:base].jpg" | |
find ./optimized -regex '.*\.\(jpg\|png\)$' -exec bash -c 'convert "$@" -define webp:lossless=false "${@%.*}".webp' _ {} \; | |
if [ $1 = "andup" ] | |
then | |
cd optimized | |
aws s3 cp . s3://printuridigital.ro/img --cache-control 'max-age=2592000' --recursive | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment