cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lala
Level IX

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 IX

回复: 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 IX

回复: 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

Recommended Articles