jpegtran whole directory

2019-03-29 10:34发布

I want to optimize the whole test folder with jpg images from a command line. I found this but it doesn't work:

cd /home/site/html/update/test/
find . -exec jpegtran -optimize "{}" "{}.opti.jpg" "{}" \;

I want to overwrite the existing images.

Suggestions?

Answer:

find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \; 

1条回答
Ridiculous、
2楼-- · 2019-03-29 11:21

Answer:

find /img/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \;
查看更多
登录 后发表回答