--- png.tcl.old	Sun Nov 26 15:54:57 2006
+++ png.tcl	Thu Apr 26 23:27:37 2007
@@ -158,6 +158,7 @@
     }
     close $fh
     set fh [open $file w]
+    fconfigure $fh -encoding binary -translation binary -eofchar {}
     puts -nonewline $fh $data
     close $fh
 }
