我试图用Gifsicle在MacOs中调整目录中所有文件的大小。我能够调整单个文件的大小。但是如何调整目录中所有文件的大小呢?
gifsicle original.gif --resize 600x600 > _resized.gif发布于 2017-11-28 19:45:14
这在巴什巴迪会管用的。
#!/bin/bash
my_path=/var/www/mywebpage/images
all_files=$( find $my_path -type f -name '*.jpg' -o -name '*.jpeg' -o -name '*.png' -o -name '*.gif' )
cd $my_path;
while read line
do
echo "About to convert $line ..."
gifsicle $line --resize 600x600 > ./tmp_image && cat ./tmp_image > $line
echo "Done!"
done <<< "$all_files"致以问候!
发布于 2017-11-28 20:21:33
这应该能行
for g in *.gif; do
d=${g%.gif}; gifsicle --resize 600x600 < "$g" > "$d-resized.gif";
donehttps://stackoverflow.com/questions/47539641
复制相似问题