Transpiled version (9246L) is out of date.
static BufferedImage scaleBufferedImageToMaxWidthOrHeight(WidthAndHeight size, BufferedImage img) { ret img == null ?: scaleBufferedImageToMaxWidthOrHeight(size.w(), size.h(), img); } static BufferedImage scaleBufferedImageToMaxWidthOrHeight(int maxW, int maxH default maxW, BufferedImage img) { if (img == null) null; int w = img.getWidth(), h = img.getHeight(); if (w <= maxW && h <= maxH) ret img; double scale = min(doubleRatio(maxW, w), doubleRatio(maxH, h)); ret scaleImage(img, scale); } static BufferedImage scaleBufferedImageToMaxWidthOrHeight(BufferedImage img, int max) { ret scaleBufferedImageToMaxWidthOrHeight(max, img); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015057 |
Snippet name: | scaleBufferedImageToMaxWidthOrHeight |
Eternal ID of this version: | #1015057/6 |
Text MD5: | 68495bce051bd30d667bcbf0037a78ed |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-12-05 16:41:58 |
Source code size: | 668 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 420 / 522 |
Version history: | 5 change(s) |
Referenced in: | [show references] |