From b958c96c9c3e127cc656e5775692e7a2a5c3b05d Mon Sep 17 00:00:00 2001 From: Remco Date: Wed, 18 Nov 2020 14:19:50 +0100 Subject: [PATCH] Fixed bug --- .../org/krews/apollyon/incoming/CameraRoomPictureEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/krews/apollyon/incoming/CameraRoomPictureEvent.java b/src/main/java/org/krews/apollyon/incoming/CameraRoomPictureEvent.java index 1c7c01d..8dd7fac 100644 --- a/src/main/java/org/krews/apollyon/incoming/CameraRoomPictureEvent.java +++ b/src/main/java/org/krews/apollyon/incoming/CameraRoomPictureEvent.java @@ -36,6 +36,7 @@ public class CameraRoomPictureEvent extends MessageHandler { final int count = this.packet.readInt(); ByteBuf image = this.packet.getBuffer().readBytes(count); + ByteBuf imageCopy = image.copy(); if (image == null) return; @@ -67,7 +68,7 @@ public class CameraRoomPictureEvent extends MessageHandler { FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL); FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL_small); } else { - BufferedImage theImage = ImageIO.read(new ByteBufInputStream(image)); + BufferedImage theImage = ImageIO.read(new ByteBufInputStream(imageCopy)); ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.camera") + URL)); ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.camera") + URL_small)); }