… | |
… | |
147 | # possibly enlarge |
147 | # possibly enlarge |
148 | if (0 > aio_stat "$stem.64x64.png") { |
148 | if (0 > aio_stat "$stem.64x64.png") { |
149 | my $other = "$stem.64x64.png~"; |
149 | my $other = "$stem.64x64.png~"; |
150 | |
150 | |
151 | if (0 > aio_lstat $other or (-M _) > (-M $path)) { |
151 | if (0 > aio_lstat $other or (-M _) > (-M $path)) { |
152 | warn "rescale $other\n";#d# |
|
|
153 | my $wrap = 0; # for the time being |
152 | my $wrap = 0; # for the time being |
154 | fork_sub { |
153 | fork_sub { |
155 | system "convert png:\Q$path\E -depth 8 rgba:-" |
154 | system "convert png:\Q$path\E -depth 8 rgba:-" |
156 | . "| $exec_prefix/bin/cfhq2xa $w $h $wrap" |
155 | . "| $exec_prefix/bin/cfhq2xa $w $h $wrap" |
157 | . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~" |
156 | . "| convert -depth 8 -size ".($w * 2)."x".($h * 2)." rgba:- $QUANTIZE -quality 00 png32:\Q$other\E~" |
… | |
… | |
176 | die "$other~ has zero size, aborting." unless -s "$other~"; |
175 | die "$other~ has zero size, aborting." unless -s "$other~"; |
177 | rename "$other~", $other; |
176 | rename "$other~", $other; |
178 | }; |
177 | }; |
179 | } |
178 | } |
180 | |
179 | |
181 | warn "scaled down $path to $other\n";#d# |
180 | #warn "scaled down $path to $other\n";#d# |
182 | |
|
|
183 | push @png, [$other, !$CACHE]; |
181 | push @png, [$other, !$CACHE]; |
184 | } |
182 | } |
185 | } |
183 | } |
186 | |
184 | |
187 | (my $face = $stem) =~ s/^.*\///; |
185 | (my $face = $stem) =~ s/^.*\///; |
… | |
… | |
406 | { |
404 | { |
407 | while (my ($k, $v) = each %FACEINFO) { |
405 | while (my ($k, $v) = each %FACEINFO) { |
408 | length $v->{data32} or warn "$k: face has no png32. this will not work (shoddy gcfclient will crash of course).\n"; |
406 | length $v->{data32} or warn "$k: face has no png32. this will not work (shoddy gcfclient will crash of course).\n"; |
409 | length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n"; |
407 | length $v->{data64} or warn "$k: face has no png64. this will not work very well.\n"; |
410 | |
408 | |
|
|
409 | length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; |
|
|
410 | #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; |
|
|
411 | |
411 | $v->{chksum32} = Digest::MD5::md5 $v->{data32}; |
412 | $v->{chksum32} = Digest::MD5::md5 $v->{data32}; |
412 | $v->{chksum64} = Digest::MD5::md5 $v->{data64}; |
413 | $v->{chksum64} = Digest::MD5::md5 $v->{data64}; |
413 | } |
414 | } |
414 | |
415 | |
415 | open my $fh, ">:perlio", "$DATADIR/facedata~" |
416 | open my $fh, ">:perlio", "$DATADIR/facedata~" |