/ Published in: Perl
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.
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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!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) { } } }
URL: http://haxpor.org/post/12923010987/how-to-optimize-applications-file-size-with-free-tools