fixed bug where bytes where being copied incorrectly
This commit is contained in:
parent
89add83bcd
commit
4cdfbf0ce6
@ -55,13 +55,14 @@ public class CameraRoomPictureEvent extends MessageHandler
|
|||||||
this.client.getHabbo().getHabboInfo().setPhotoJSON(json);
|
this.client.getHabbo().getHabboInfo().setPhotoJSON(json);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BufferedImage theImage = ImageIO.read(new ByteBufInputStream(image));
|
|
||||||
if(Emulator.getConfig().getInt("ftp.enabled") == 1) {
|
if(Emulator.getConfig().getInt("ftp.enabled") == 1) {
|
||||||
byte[] imageBytes = ((DataBufferByte) theImage.getData().getDataBuffer()).getData();
|
byte[] imageBytes = new byte[image.readableBytes()];
|
||||||
|
image.readBytes(imageBytes);
|
||||||
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL);
|
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL);
|
||||||
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL_small);
|
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.camera") + URL_small);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
BufferedImage theImage = ImageIO.read(new ByteBufInputStream(image));
|
||||||
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));
|
||||||
ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.camera") + URL_small));
|
ImageIO.write(theImage, "png", new File(Emulator.getConfig().getValue("imager.location.output.camera") + URL_small));
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,8 @@ public class CameraRoomThumbnailEvent extends MessageHandler
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if(Emulator.getConfig().getInt("ftp.enabled") == 1) {
|
if(Emulator.getConfig().getInt("ftp.enabled") == 1) {
|
||||||
byte[] imageBytes = ((DataBufferByte) theImage.getData().getDataBuffer()).getData();
|
byte[] imageBytes = new byte[image.readableBytes()];
|
||||||
|
image.readBytes(imageBytes);
|
||||||
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.thumbnail") + room.getId() + ".png");
|
FTPUploadService.uploadImage(imageBytes, Emulator.getConfig().getValue("imager.location.output.thumbnail") + room.getId() + ".png");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user