ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/cfutil.in
(Generate patch)

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.50 by root, Thu Aug 9 22:54:28 2007 UTC vs.
Revision 1.51 by root, Sat Aug 18 20:39:14 2007 UTC

19use IO::AIO (); 19use IO::AIO ();
20use File::Temp; 20use File::Temp;
21use Crossfire; 21use Crossfire;
22use Coro; 22use Coro;
23use Coro::AIO; 23use Coro::AIO;
24use Coro::Util;
24use POSIX (); 25use POSIX ();
25use Digest::MD5; 26use Digest::MD5;
26use Carp; 27use Carp;
27use Coro::Storable; $Storable::canonical = 1; 28use Coro::Storable; $Storable::canonical = 1;
28 29
170 # possibly enlarge 171 # possibly enlarge
171 if (0 > aio_stat "$stem.64x64.png") { 172 if (0 > aio_stat "$stem.64x64.png") {
172 my $other = "$stem.64x64.png~"; 173 my $other = "$stem.64x64.png~";
173 174
174 if (0 > aio_lstat $other or (-M _) > (-M $path)) { 175 if (0 > aio_lstat $other or (-M _) > (-M $path)) {
175 my $wrap = 0; # for the time being
176 fork_sub { 176 fork_sub {
177 system "convert png:\Q$path\E -depth 8 rgba:-" 177 system "convert -depth 8 png:\Q$path\E rgba:-"
178 . "| $exec_prefix/bin/cfhq2xa $w $h $wrap" 178 . "| $exec_prefix/bin/cfhq2xa $w $h 0"
179 . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~" 179 . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~"
180 and die "convert/hq2xa pipeline error: status $? ($!)"; 180 and die "convert/hq2xa pipeline error: status $? ($!)";
181 system $OPTIPNG, "-i0", "-q", "$other~"; 181 system $OPTIPNG, "-i0", "-q", "$other~";
182 die "$other~ has zero size, aborting." unless -s "$other~"; 182 die "$other~ has zero size, aborting." unless -s "$other~";
183 rename "$other~", $other; 183 rename "$other~", $other;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines