0

我有一个高清图像文件夹,+2000px 宽度:

+ /img/
   +- /bikes/: few images here (jpg,png,svg)
   +- /cars/ : few images here
   +- /cats/ : few images here
   +- /dogs/ : few images here
   +- /...

我想将整个图像调整为 200px 宽度的图像(相同的比例),但保留文件夹结构。

怎么做?

4

1 回答 1

2

你可以这样做,但请先备份!

find . -depth -type d \! -name '.' -exec bash -c 'cd $0 || exit; mkdir thumbs 2> /dev/null; shopt -s nullglob; mogrify -path thumbs -resize 200x *.jpg *.svg *.png ' {} \;

这将为您提供在每个目录中调用的子目录thumbs,其中包含较小的版本

于 2016-02-03T16:36:29.750 回答