procimage
来自「linux脚本编程的例子」· 代码 · 共 55 行
TXT
55 行
# Set up the defaultswidth=1colour='-color grey'usage="Usage: $0 [-s N] [-w N] [-c S] imagefile..."# Initialise the pipeline componentsstandardise=' | ppmquant -quiet 256 | ppmtogif -quiet'while getopts ":s:w:c:" opt; do case $opt in s ) size=$OPTARG scale=' | pnmscale -quiet -xysize $size $size' ;; w ) width=$OPTARG border=' | pnmmargin $colour $width' ;; c ) colour="-color $OPTARG" border=' | pnmmargin $colour $width' ;; \? ) echo $usage exit 1 ;; esacdoneshift $(($OPTIND - 1))if [ -z "$@" ]; then echo $usage exit 1fi# Process the input filesfor filename in "$@"; do case $filename in *.gif ) convert=giftopnm ;; *.tga ) convert=tgatoppm ;; *.xpm ) convert=xpmtoppm ;; *.pcx ) convert=pcxtoppm ;; *.tif ) convert=tifftopnm ;; *.jpg ) convert=djpeg ;; * ) echo "$0: Unknown filetype '${filename##*.}'" exit 1;; esac outfile=${filename%.*}.new.gif eval $convert $filename $scale $border $standardise > $outfiledone
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?