Guest User

Untitled

a guest
Jun 25th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. function imageConvert()
  4. {
  5. size=$1
  6. inputFile=$2
  7. filename=${inputFile%.*}
  8. extension=${inputFile#*.}
  9. outputFile=${filename}"W"${size}"."${extension}
  10. convert -resize $size $inputFile $outputFile
  11. echo "output"${outputFile}
  12. }
  13.  
  14. # check imageMagick is Install
  15. which convert > /dev/null 2>&1
  16. if [ $? != 0 ]; then
  17. echo "please install imageMagick first"
  18. exit -1
  19. fi
  20.  
  21. if [$1 !=0 ]; then
  22. echo "please check input file path"
  23. exit -1
  24. fi
  25.  
  26. imageConvert 40 $1
  27. imageConvert 60 $1
  28. imageConvert 58 $1
  29. imageConvert 87 $1
  30. imageConvert 80 $1
  31. imageConvert 120 $1
  32. imageConvert 128 $1
  33. imageConvert 180 $1
  34. imageConvert 20 $1
  35. imageConvert 29 $1
  36. imageConvert 87 $1
  37. imageConvert 152 $1
  38. imageConvert 167 $1
  39. imageConvert 1024 $1
Add Comment
Please, Sign In to add comment