X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Fdictionary-update-receiver;fp=pctb%2Fdictionary-update-receiver;h=d80ab216b338220049d8ab6387061cf1c0d4386f;hp=99a580e46888280c1c589a442edff38c6ea662cc;hb=d79262d3c0bc002beb7888568d74d26e27852699;hpb=065b523c45b707e7b4f49a9d976f901f8a6e9061 diff --git a/pctb/dictionary-update-receiver b/pctb/dictionary-update-receiver index 99a580e..d80ab21 100755 --- a/pctb/dictionary-update-receiver +++ b/pctb/dictionary-update-receiver @@ -19,6 +19,8 @@ use CGI qw/:standard -private_tempfiles/; use IO::Pipe; use IO::Handle; +my $aadepth=3; + #---------- pixmaps ---------- sub parseentryin__pixmap ($) { @@ -78,9 +80,12 @@ print STDERR ">@d<\n"; my $w= @d; - my $pgm= "P2\n$h $w\n7\n"; + my $maxval= (1<<$aadepth)-1; + die 'cannot do [^0...$maxval]!' if $maxval>9; + + my $pgm= "P2\n$h $w\n$maxval\n"; map { # x, left to right - m/[^0-7]/ and die "$_ ?"; + m/[^0-$maxval]/ and die "$_ ?"; my $l= $_; $l =~ s/./ $&/g; $pgm .= "$l\n"; @@ -257,7 +262,7 @@ open F, "> $fn_t" or die "$fn_t $!"; (stat F) or die $!; my $fn_i= sprintf "_update.$$-%016x.rdy", (stat _)[1]; -print F "ypp-sc-tools dictionary update v2\n"; +print F "ypp-sc-tools dictionary update v3 depth=$aadepth\n"; foreach my $v ($pirate,$caller,$dict,$ctx,$def,$image,$key,$val) { printf F "%d\n", length($v) or die $!;