1 | static File putImageInDirectory_jpeg(BufferedImage img, File dir) { |
2 | if (img == null) null; |
3 | byte[] data = toJPEG(img); |
4 | S md5 = md5(data); |
5 | File f = newFile(dir, md5 + ".jpg"); |
6 | if (!f.exists()) |
7 | saveBinaryFile(f, data); |
8 | ret f; |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019183 |
Snippet name: | putImageInDirectory_jpeg - uses MD5 of JPEG file as file name |
Eternal ID of this version: | #1019183/3 |
Text MD5: | 1e7502ae29a01e011f09be1e29b2a95b |
Author: | stefan |
Category: | javax / image io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-11-06 19:02:40 |
Source code size: | 248 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 350 / 372 |
Version history: | 2 change(s) |
Referenced in: | [show references] |