Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement