diff --git a/src/main/java/me/TechsCode/TechDiscordBot/util/Plugin.java b/src/main/java/me/TechsCode/TechDiscordBot/util/Plugin.java index d3ffa2ba..28984837 100644 --- a/src/main/java/me/TechsCode/TechDiscordBot/util/Plugin.java +++ b/src/main/java/me/TechsCode/TechDiscordBot/util/Plugin.java @@ -98,9 +98,17 @@ public String getBanner() { public File getBannerAsFile() { try { BufferedImage image = ImageIO.read(new URL(getBanner())); + + Image scaled = image.getScaledInstance(960, 540, Image.SCALE_SMOOTH); + BufferedImage bufferedImage = new BufferedImage(960, 540, BufferedImage.TYPE_INT_ARGB); + + Graphics2D bGr = bufferedImage.createGraphics(); + bGr.drawImage(scaled, 0, 0, null); + bGr.dispose(); + File file = new File(getRoleName().toLowerCase() + "_banner.png"); - ImageIO.write(image, "png", file); + ImageIO.write(bufferedImage, "png", file); return file; } catch (IOException e) { e.printStackTrace();