mirror of
https://github.com/Noratrieb/killua-bot.git
synced 2026-01-16 16:15:03 +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 {
|
private byte[] resizeImage(byte[] bytes, String format, int size) throws IOException {
|
||||||
reply("Image size too big (" + bytes.length / 1000 + "kB). Resizing image...");
|
reply("Image size too big (" + bytes.length / 1000 + "kB). Resizing image...");
|
||||||
Image image = ImageIO.read(new ByteArrayInputStream(bytes));
|
Image image = ImageIO.read(new ByteArrayInputStream(bytes));
|
||||||
int ratio = image.getHeight(null) / image.getWidth(null);
|
double ratio = (double)image.getHeight(null) / (double)image.getWidth(null);
|
||||||
image = image.getScaledInstance(size, size * ratio, Image.SCALE_SMOOTH);
|
image = image.getScaledInstance(size, (int) (size * ratio), Image.SCALE_SMOOTH);
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
|
||||||
BufferedImage bufferedImg = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
|
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