X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=OSX%2Fupdate-thumbnail.pl;fp=OSX%2Fupdate-thumbnail.pl;h=1f5eccee7c3c56f75d0ca49a97a0f6d697bbf3c7;hp=0df5d1f72ac7eea19fb0ebdf47a6878eb6d3d34f;hb=2762a7d7cf8d83e68b8f635941f6609119d630ae;hpb=4ade52359b6eba3621566dac79793a33aa4c915f diff --git a/OSX/update-thumbnail.pl b/OSX/update-thumbnail.pl index 0df5d1f7..1f5eccee 100755 --- a/OSX/update-thumbnail.pl +++ b/OSX/update-thumbnail.pl @@ -18,7 +18,7 @@ require 5; use strict; my $progname = $0; $progname =~ s@.*/@@g; -my $version = q{ $Revision: 1.2 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; +my $version = q{ $Revision: 1.3 $ }; $version =~ s/^[^0-9]+([0-9.]+).*$/$1/; my $verbose = 1; @@ -95,6 +95,8 @@ sub update($$) { "-resize", $size . "^", "-gravity", "center", "-extent", $size, + "-quality", "95", # saves 8% + "+dither", "-colors", "128", # Saves an additional 61% $tmp); print STDERR "$progname: exec: " . join(' ', @cmd) . "\n" @@ -106,6 +108,17 @@ sub update($$) { error ("failed: " . join(" ", @cmd)); } + # This only saves 0.4% on top of the above. + # @cmd = ("optipng", "-quiet", "-o7", $tmp); + # print STDERR "$progname: exec: " . join(' ', @cmd) . "\n" + # if ($verbose > 2); + # safe_system (@cmd); + + if (! -s $tmp) { + unlink $tmp; + error ("failed: " . join(" ", @cmd)); + } + if (! cmp_files ($tmp, $target)) { unlink $tmp; print STDERR "$progname: $target: unchanged\n" if ($verbose > 1);