yes. First use

x = load("test.png", TRUE)

this loads test.png as a binary file, creating an associative array of
information in the file in the form of binary arrays.

$ x = load("test.png", TRUE)
$ print x.keys
$_BINARY_$
1deh.pdb.gz
JmolManifest.txt
Jmol_version_14.3.16_2015.08.17__2015-08-17_22.19
_IMAGE_
state.spt

Now you can inspect these. Caution, though! They are binary arrays. The
ascii files will look OK, but they are still not strings!

$ print x["JmolManifest.txt"].type
bytearray

$ print x["JmolManifest.txt"]
# Jmol Manifest Zip Format 1.1
# Created Tue Aug 18 18:22:06 CDT 2015
# JmolVersion 14.3.16_2015.08.17  2015-08-17 22:19
state.spt

[Note that JmolManifest.txt is not run - Jmol only looks for the first
".spt" file in it and runs that.]

# turn the byte array into a string:

s = "" + x["JmolManifest.txt"]

[change s]

# write it back into x

x["JmolManifest.txt"] = s;

# creating more stuff in x

x["testing.spt"] = "background red";

# write a new PNGJ file

write VAR x "test2.png"

UNFORTUNATELY there is a bug there in that very last command. Jmol
currently writes a ZIP file instead of a PNGJ file.

I've put up at least a Jmol.jar file that corrects that, Rolf.

http://chemapps.stolaf.edu/jmol/zip/Jmol.jar

Jmol.___JmolVersion="14.3.16_2015.08.21"

bug fix: write VAR x "test.png" creates a ZIP file instead of a PNGJ file
when x is from load("test.png",true)



​
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to