cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
lala
Level VIII

How to use JSL to restore a picture binary to a picture in a table?

The image binary file is downloaded from the web using JSL in the format of.

2022-11-25_11-07-14.png
I tried the following JSL, which cannot be loaded as a picture in the table.

 

rs=New HTTP Request(URL(u),Method("GET"),Headers(h));
rr=rs<<Send;

img="New Image(Char To Blob("||rr||"base64compressed\!"),\!"png\!")";
dt=New Table("kk",Add Rows(1),New Column("A", Expression),New Column("B", Expression),New Column("C", Expression));
dt[1,1]=img;

I have attached the results of this binary file.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

回复: How to use JSL to restore a picture binary to a picture in a table?

u = "https://community.jmp.com/t5/image/serverpage/image-id/47607iC302B97FB4C8A9DF/image-size/large?v=v2&px=999";

rs=New HTTP Request(URL(u),Method("GET"));
rr=rs<<Send;

img=open(rr,"PNG");
dt=New Table("kk",Add Rows(1),New Column("A", Expression),New Column("B", Expression),New Column("C", Expression));
dt[1,1]=img;

capture.png

If you don't need the httprequest, open can fetch the url directly. Above, httprequest fetched a BLOB from the server and open accepts the BLOB in place of a file name; open needs the explicit file type since the BLOB does not know the extension.

Craige

View solution in original post

3 REPLIES 3
lala
Level VIII

回复: How to use JSL to restore a picture binary to a picture in a table?

  • Use  browser to download the image and save it to a local file. Then load it with JMP

2022-11-25_11-20-12.png

lala
Level VIII

回复: How to use JSL to restore a picture binary to a picture in a table?

  • Does it indicate that this binary requires further conversion?

txt=Decode64 Blob(rr);

2022-11-25_10-46-50.png

Craige_Hales
Super User

回复: How to use JSL to restore a picture binary to a picture in a table?

u = "https://community.jmp.com/t5/image/serverpage/image-id/47607iC302B97FB4C8A9DF/image-size/large?v=v2&px=999";

rs=New HTTP Request(URL(u),Method("GET"));
rr=rs<<Send;

img=open(rr,"PNG");
dt=New Table("kk",Add Rows(1),New Column("A", Expression),New Column("B", Expression),New Column("C", Expression));
dt[1,1]=img;

capture.png

If you don't need the httprequest, open can fetch the url directly. Above, httprequest fetched a BLOB from the server and open accepts the BLOB in place of a file name; open needs the explicit file type since the BLOB does not know the extension.

Craige