mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-14 15:15:01 +01:00
wtf git
This commit is contained in:
parent
2671658b5d
commit
193674d6f0
1 changed files with 2 additions and 2 deletions
|
|
@ -116,8 +116,8 @@ public class EmoteAddCommand extends Command {
|
|||
private byte[] resizeImage(byte[] bytes, String format, int size) throws IOException {
|
||||
reply("Image size too big (" + bytes.length / 1000 + "kB). Resizing image...");
|
||||
Image image = ImageIO.read(new ByteArrayInputStream(bytes));
|
||||
int ratio = image.getHeight(null) / image.getWidth(null);
|
||||
image = image.getScaledInstance(size, size * ratio, Image.SCALE_SMOOTH);
|
||||
double ratio = (double)image.getHeight(null) / (double)image.getWidth(null);
|
||||
image = image.getScaledInstance(size, (int) (size * ratio), Image.SCALE_SMOOTH);
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
BufferedImage bufferedImg = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue