1 | static byte[] rawImageFromImageServer(S md5) ctex { |
2 | assertTrue(isMD5(md5)); |
3 | |
4 | File dir = getCacheProgramDir("Images-by-MD5"); |
5 | File file = new File(dir, md5 + ".png"); |
6 | if (file.exists() && file.length() != 0) pcall { |
7 | ret ImageIO.read(file); |
8 | } |
9 | |
10 | byte[] data = loadBinaryPage(imageServerLink(md5)); |
11 | assertTrue(isPNG(data)); |
12 | ret data; |
13 | } |
Began life as a copy of #1005781
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007518 |
Snippet name: | rawImageFromImageServer |
Eternal ID of this version: | #1007518/3 |
Text MD5: | fae660820b8e225af9e2ce3be7deb3f3 |
Author: | stefan |
Category: | javax / images |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-25 22:56:04 |
Source code size: | 364 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 504 / 522 |
Version history: | 2 change(s) |
Referenced in: | [show references] |