Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. rm -rf optimized/**
  4. mkdir -p optimized/400w
  5.  
  6. 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"
  7. 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"
  8.  
  9. find ./optimized -regex '.*\.\(jpg\|png\)$' -exec bash -c 'convert "$@" -define webp:lossless=false "${@%.*}".webp' _ {} \;
  10.  
  11. if [ $1 = "andup" ]
  12. then
  13. cd optimized
  14. aws s3 cp . s3://printuridigital.ro/img --cache-control 'max-age=2592000' --recursive
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement