使用pngcrush的Perl脚本,用于1级文件夹层次结构
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用pngcrush的Perl脚本,用于1级文件夹层次结构相关的知识,希望对你有一定的参考价值。
Wrote this script to work with pngcrush command line based program on Windows system to compress several .png images in multiple folders (with only 1 level of folders, rather than that you have to repeat doing it manually).It's fast, and help doing the task at hand but it's completely clean.
Please note that the code doesn't take care for all un-expected result, it just does the job in controlled environment.
This script relates to my optimization on application's file size, check it out at the URL above.
#!E:/strawberry/perl/bin/perl # Handy script for using pngcrush to compress the size of png files in multiple folders $dir = "C:/Users/Haxpor/Desktop/in"; $out = "C:/Users/Haxpor/Desktop/out/"; foreach $folder (@folders) { # read in each folder # create dir in output folder # process each file foreach $file (@files) { if(-f $dir."/".$folder."/".$file && $file =~ /.*.png/i) { } } }
以上是关于使用pngcrush的Perl脚本,用于1级文件夹层次结构的主要内容,如果未能解决你的问题,请参考以下文章
为啥 ncat -exec 可以与 shell 脚本一起使用,但不能与 perl 脚本一起使用?