简体   繁体   English

如何使用pagespeed_optimize_image.exe进行批量图像优化?

[英]How to use pagespeed_optimize_image.exe for bulk image optimization?

For one image this can be done by 对于一张图片,可以通过

pagespeed_optimize_image.exe image.jpg image_optimised.jpg

in cmd line. 在cmd行中。 But is it possible to use this tool for bulk image optimization? 但是可以使用此工具进行批量图像优化吗?

Pop open your powershell and run the following: 弹出打开您的Powershell并运行以下命令:

Warning: This will replace all your jpg files as the output is the same as the input. 警告:这将替换您所有的jpg文件,因为输出与输入相同。

Warning: This will only work on jpg files as you can see the filter below, change to use pngs too. 警告:这仅适用于jpg文件,因为您可以看到下面的过滤器,也可以更改为使用png。

Get-ChildItem -Filter *.jpg | ForEach { D:\\absolute\\path\\to\\pagespeed_optimize_image.exe $_.Fullname $_.Fullname }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM