Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1015317 // jpegify - convert image file to JPEG

JavaX fragment (include)

static File jpegify(File imageFile) {
  if (isJPEGFile(imageFile)) ret imageFile;
  loading "JPEGify" {
    BufferedImage img = loadImage2(imageFile);
    File destFile = replaceExtension(imageFile, ".jpg");
    File atticFile = newFile(javaxDataDir("JPEGified original pictures"), imageFile.getName());
    atticFile = makeFileNameUnique(atticFile);
    saveJPGVerbose(destFile, img);
    moveFileVerbose(imageFile, atticFile);
    print("Conversion done.");
    ret destFile;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1015317
Snippet name: jpegify - convert image file to JPEG
Eternal ID of this version: #1015317/8
Text MD5: 4505ab9140bb344d83400d158f62a878
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-31 17:26:58
Source code size: 495 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 610 / 564
Version history: 7 change(s)
Referenced in: [show references]