Libraryless. Click here for Pure Java version (9172L/53K).
1 | // defaults to .png |
2 | static File saveImageWithCounter(File dir, S baseName, BufferedImage img) { |
3 | if (img == null || dir == null) null; |
4 | |
5 | if (!isImageFileName(baseName)) baseName += ".png"; |
6 | File f = makeFileNameUnique_beforeExtension_startWith1_noDot(newFile(dir, baseName)); |
7 | saveImage(f, img); |
8 | infoBox("Saved image " + appendBracketed(img.getWidth(null) + "*" + img.getHeight(null)) + ": " + fileInfo(f)); |
9 | ret f; |
10 | } |
Began life as a copy of #1033849
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033905 |
Snippet name: | saveImageWithCounter |
Eternal ID of this version: | #1033905/3 |
Text MD5: | 19d3a00f9b330e274cf666854781ddf2 |
Transpilation MD5: | 7448e2c87957b173f0d2498dfe32dbf1 |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-09 19:59:58 |
Source code size: | 435 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 166 / 231 |
Version history: | 2 change(s) |
Referenced in: | [show references] |