From e892d57dfaea6bf2391b8a015b57d48b8d84d415 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 11 Mar 2013 18:26:14 -0500 Subject: [PATCH] [pngzop] Deleted picksmaller (no longer used); added try-pngzop script --- picksmaller | 20 -------------------- try-pngzop | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) delete mode 100755 picksmaller create mode 100755 try-pngzop diff --git a/picksmaller b/picksmaller deleted file mode 100755 index e80697b8e..000000000 --- a/picksmaller +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# For use in the pngzop project -# Copyright 2013 by Glenn Randers-Pehrson -# Released under the pngcrush license (equivalent to the libpng license) - -# Selects the smaller of file.zdat (extracted from a PNG) or -# file.idat.zlib (same but recompressed with zopfli) - -# picksmaller *.zdat - -for file in $* -do -file1=$1 -file2=`echo $file1 | sed -e "s/zdat/idat.zlib/"` -shift - -ls -S $file1 $file2 | tail -1 - -done diff --git a/try-pngzop b/try-pngzop new file mode 100755 index 000000000..fc43c7aa1 --- /dev/null +++ b/try-pngzop @@ -0,0 +1,28 @@ +#!/bin/sh + +# try-pngzop + +# usage: try-pngzop dir ... + +# runs pngzop on each PNG file in a set of directories + +# For use in the pngzop project +# Copyright 2013 by Glenn Randers-Pehrson +# Released under the pngcrush license (equivalent to the libpng license) + +# From a PNG file, finds the smallest resulting compressed IDAT +# data from zopfli compression of filter types 0 through 4 and +# "adaptive" (f5) filtering. + +for dir in $* +do +( + cd $dir + for n in *.png + do + pngzop $n > $n.zop + pngcrush -brute -force $n $n.bf.png + pngzdat $n.bf.png + done +) +done