Libraryless. Click here for Pure Java version (9172L/53K).
// defaults to .png static File saveImageWithCounter(File dir, S baseName, BufferedImage img) { if (img == null || dir == null) null; if (!isImageFileName(baseName)) baseName += ".png"; File f = makeFileNameUnique_beforeExtension_startWith1_noDot(newFile(dir, baseName)); saveImage(f, img); infoBox("Saved image " + appendBracketed(img.getWidth(null) + "*" + img.getHeight(null)) + ": " + fileInfo(f)); ret f; }
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: | 167 / 232 |
Version history: | 2 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |