From 9dc25e3594e928a546252b241c4ce5c3576520ed Mon Sep 17 00:00:00 2001 From: Dank074 Date: Thu, 8 Aug 2019 18:50:24 -0500 Subject: [PATCH] almost had it --- .../apollyon/incoming/CameraRoomThumbnailEvent.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/krews/apollyon/incoming/CameraRoomThumbnailEvent.java b/src/main/java/org/krews/apollyon/incoming/CameraRoomThumbnailEvent.java index 924ec37..8cb9f46 100644 --- a/src/main/java/org/krews/apollyon/incoming/CameraRoomThumbnailEvent.java +++ b/src/main/java/org/krews/apollyon/incoming/CameraRoomThumbnailEvent.java @@ -48,13 +48,6 @@ public class CameraRoomThumbnailEvent extends MessageHandler this.packet.readInt(); this.packet.readInt(); - BufferedImage theImage = null; - try { - theImage = ImageIO.read(new ByteBufInputStream(image)); - } catch (IOException e) { - e.printStackTrace(); - } - try { if(Emulator.getConfig().getInt("ftp.enabled") == 1) { byte[] imageBytes = new byte[image.readableBytes()]; @@ -62,7 +55,9 @@ public class CameraRoomThumbnailEvent extends MessageHandler FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.thumbnail") + room.getId() + ".png"); } else { - ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.thumbnail") + room.getId() + ".png")); + BufferedImage theImage = null; + theImage = ImageIO.read(new ByteBufInputStream(image)); + ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.thumbnail") + room.getId() + ".png")); } } catch (IOException e) { e.printStackTrace();