From e502e2c7363246ffe99e263c58856a73636160c2 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Wed, 19 Dec 2007 22:04:38 +0000 Subject: [PATCH] Remove base64 decoding/encoding from whiteboard plugin as this must be done in the protocol. --- .../whiteboard/WhiteboardObjectImageJabberImpl.java | 4 +--- .../gui/whiteboardshapes/WhiteboardShapeImage.java | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/whiteboard/WhiteboardObjectImageJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/whiteboard/WhiteboardObjectImageJabberImpl.java index 00a3ae1f1..8d7cad6e3 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/whiteboard/WhiteboardObjectImageJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/whiteboard/WhiteboardObjectImageJabberImpl.java @@ -91,9 +91,7 @@ public WhiteboardObjectImageJabberImpl (String xml) this.setWhiteboardPoint (new WhiteboardPoint (x, y)); this.setWidth (width); this.setHeight (height); - byte[] b = img.getBytes (); - img = new String (Base64.decode (b)); - this.setBackgroundImage ( img.getBytes ()); + this.setBackgroundImage(Base64.decode(img)); } } catch (ParserConfigurationException ex) diff --git a/src/net/java/sip/communicator/plugin/whiteboard/gui/whiteboardshapes/WhiteboardShapeImage.java b/src/net/java/sip/communicator/plugin/whiteboard/gui/whiteboardshapes/WhiteboardShapeImage.java index bc7325688..1ddcfd4bd 100644 --- a/src/net/java/sip/communicator/plugin/whiteboard/gui/whiteboardshapes/WhiteboardShapeImage.java +++ b/src/net/java/sip/communicator/plugin/whiteboard/gui/whiteboardshapes/WhiteboardShapeImage.java @@ -15,7 +15,6 @@ import java.awt.geom.*; import java.util.List; import net.java.sip.communicator.service.protocol.whiteboardobjects.*; -import net.java.sip.communicator.util.Base64; /** * a WhiteboardShapeCircle, in XML : @@ -78,7 +77,7 @@ public WhiteboardShapeImage ( String id, this.whiteboardPoint = p; this.width = width; this.height = height; - this.bytes = Base64.decode(bytes); + this.bytes = bytes; ImageIcon ii = new ImageIcon (this.bytes); this.image = ii.getImage (); @@ -303,7 +302,7 @@ public void setWhiteboardPoint (WhiteboardPoint whiteboardPoint) */ public void setBackgroundImage (byte[] background) { - this.bytes = Base64.decode(background); + this.bytes = background; ImageIcon ii = new ImageIcon (this.bytes); this.image = ii.getImage (); } @@ -317,7 +316,7 @@ public void setBackgroundImage (byte[] background) */ public byte[] getBackgroundImage () { - return Base64.encode (bytes); + return bytes; } /**