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

21
LINES

< > BotCompany Repo | #1035936 // saveQOI

JavaX fragment (include) [tags: use-pretranspiled]

Uses 38K of libraries. Click here for Pure Java version (9187L/51K).

!include once #1035902 // QOI Library [Include]

svoid saveQOI(BufferedImage img, File file) ctex {
  new QOIImageWriterSPI spi;
  var imageWriter = spi.createWriterInstance();
  
  try {
    //var stream = spi.createOutputStreamInstance(file);
    var stream = ImageIO.createImageOutputStream(file);
    imageWriter.setOutput(stream);
    imageWriter.write(img);
  } finally {
    imageWriter.dispose();
  }
  
  vmBus_send wroteFile(file);
}

svoid saveQOI(File file, BufferedImage img) {
  saveQOI(img, file);
}

Author comment

Began life as a copy of #1004891

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035936
Snippet name: saveQOI
Eternal ID of this version: #1035936/5
Text MD5: 0479ef4eda5aae1cac4ca1f482896af6
Transpilation MD5: f5aa28b5132071722f06bc7cbd735556
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-15 17:27:44
Source code size: 534 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 140 / 202
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)