1
2
3
4
5
6
7
8
9
10
11
12
| # 准备工作:安装 imagemagick
sudo apt-get install imagemagick
#大图所在的目录
cd /path/to/big/images
#创建小图对应的目录结构
find . -type d -print -exec mkdir '../small/{}' -p \;
#批量转换! 等比例缩小到320x320之内 320x: 只设置宽度
find . -type f -name '*.jpg' -print -exec \
convert '{}' -resize 320x320 '../small/{}' \;
|