chiark / gitweb /
actually do version protocol; use tempfile to stop exec truncating our binary ppm
[ypp-sc-tools.db-test.git] / pctb / dictionary-manager
index 7091964c779a6eb6f09989a2ea44e275a5826fff..d9de00cb99da21296c1142952e15a2eb4961e23c 100755 (executable)
@@ -42,7 +42,7 @@
 #  if it wrote a byte to fd 4, it can take another question
 
 
-set aadepth 3
+set aadepth 2
 
 
 #---------- library routines ----------
@@ -517,7 +517,7 @@ proc upload_status {} {
 }
 
 proc maybe_upload_entry {im def} {
-    global reqkind privacy_setting env dbname quiet
+    global reqkind privacy_setting env dbname quiet aadepth
 
     debug "DB-UPDATE PRIVACY $privacy_setting"
     if {!$privacy_setting} return
@@ -526,6 +526,8 @@ proc maybe_upload_entry {im def} {
 
     set pl {}
     lappend pl dict $dbname
+    lappend pl version 3
+    lappend pl depth $aadepth
 
     if {$privacy_setting>=2} {
        set pirate [string totitle $env(YPPSC_PIRATE)]
@@ -693,9 +695,11 @@ proc char_read_pgm {f} {
        append o $ointerl
     }
 
-#    debug "DATA $o"
-    set data [exec pnmscale 1 << $o]
-    image create photo image/main -data $data
+    debug "DATA1 $o"
+    set tmpfile ./#dictimage#.tmp
+    exec pnmscale 1 << $o >$tmpfile
+    image create photo image/main -file $tmpfile
+    file delete $tmpfile
 }
 
 #---------- character set editor display ----------