1 | static BufferedImage scaleBufferedImageToMaxPixels(int max, BufferedImage img) {
|
2 | int w = img.getWidth(), h = img.getHeight(); |
3 | if (w*h <= max) ret img; |
4 | double scale = max/(double) (w*h); |
5 | ret scaleImage(img, scale); |
6 | } |
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: | 581 / 627 |
| Referenced in: | [show references] |