static BufferedImage scaleBufferedImageToMaxPixels(int max, BufferedImage img) { int w = img.getWidth(), h = img.getHeight(); if (w*h <= max) ret img; double scale = max/(double) (w*h); ret scaleImage(img, scale); }
Began life as a copy of #1015057
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: | #1015443 |
Snippet name: | scaleBufferedImageToMaxPixels |
Eternal ID of this version: | #1015443/1 |
Text MD5: | 3174c8f640b7aed41d1e1fc84914e008 |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-14 00:51:04 |
Source code size: | 228 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 322 / 361 |
Referenced in: | [show references] |