My static website generator using poole https://www.xythobuz.de
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

web-image-resize 692B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. if [ -z "$1" ]; then
  3. echo "No argument supplied"
  4. exit 1
  5. fi
  6. dir=$(dirname "${1}")
  7. image=$(basename -- "${1}")
  8. ext="${image##*.}"
  9. name="${image%.*}"
  10. thumb="${name}_small.${ext}"
  11. orig="${name}_bak.${ext}"
  12. echo "Directory : $dir"
  13. echo "Input file: $image"
  14. #echo "Backup : $orig"
  15. echo "Thumbnail : $thumb"
  16. cd "$dir"
  17. echo cp $image $orig
  18. cp "$image" "$orig"
  19. echo convert "$orig" -auto-orient -resize 1600x1600\> -strip "$image"
  20. convert "$orig" -auto-orient -resize 1600x1600\> -strip "$image"
  21. echo convert "$image" -auto-orient -thumbnail 300x300\> -strip "$thumb"
  22. convert "$image" -auto-orient -thumbnail 300x300\> -strip "$thumb"
  23. echo rm -rf "$orig"
  24. rm -rf "$orig"