Index: src/java/org/jivesoftware/spark/ui/ContactInfoWindow.java
===================================================================
--- src/java/org/jivesoftware/spark/ui/ContactInfoWindow.java	(revision 10980)
+++ src/java/org/jivesoftware/spark/ui/ContactInfoWindow.java	(working copy)
@@ -24,6 +24,7 @@
 import org.jivesoftware.sparkimpl.plugin.gateways.transports.TransportUtils;
 
 import javax.swing.*;
+
 import java.awt.*;
 import java.awt.event.MouseEvent;
 import java.net.MalformedURLException;
@@ -220,7 +221,13 @@
             }
 
             if (icon != null && icon.getIconHeight() > 1) {
-                icon = GraphicUtils.scaleImageIcon(icon, 96, 96);
+            	//icon = GraphicUtils.scaleImageIcon(icon, 96, 96);
+            	
+            	//scale image if the height is bigger than 96
+            	if(icon.getIconHeight() > 96){
+            	
+            		icon = new ImageIcon(icon.getImage().getScaledInstance(-1, 96, Image.SCALE_SMOOTH));
+            	}
                 avatarLabel.setIcon(icon);
             }
             else {
Index: src/java/org/jivesoftware/spark/ui/themes/ThemePanel.java
===================================================================
--- src/java/org/jivesoftware/spark/ui/themes/ThemePanel.java	(revision 10980)
+++ src/java/org/jivesoftware/spark/ui/themes/ThemePanel.java	(working copy)
@@ -84,7 +84,7 @@
 
         showAvatarsBox = new JCheckBox();
         avatarSizeLabel = new JLabel();
-        String[] sizeChoices = {"16x16", "24x24", "32x32"};
+        String[] sizeChoices = {"16", "24", "32"};
         avatarSizeField = new JComboBox(sizeChoices);
 
         contactListFontField = new JTextField();
Index: src/java/org/jivesoftware/spark/ui/status/StatusBar.java
===================================================================
--- src/java/org/jivesoftware/spark/ui/status/StatusBar.java	(revision 10980)
+++ src/java/org/jivesoftware/spark/ui/status/StatusBar.java	(working copy)
@@ -429,7 +429,11 @@
                 if (avatarBytes != null && avatarBytes.length > 0) {
                     try {
                         ImageIcon avatarIcon = new ImageIcon(avatarBytes);
-                        avatarIcon = VCardManager.scale(avatarIcon);
+                    	Image avatarImage = avatarIcon.getImage();
+                        if (avatarIcon.getIconHeight() > 64) {
+                            avatarImage = avatarImage.getScaledInstance(-1, 64, Image.SCALE_SMOOTH);
+                        }
+                        avatarIcon = new ImageIcon(avatarImage);
                         imageLabel.setIcon(avatarIcon);
                         imageLabel.setBorder(BorderFactory.createBevelBorder(0, Color.white, Color.lightGray));
                         imageLabel.invalidate();
Index: src/java/org/jivesoftware/spark/ui/VCardPanel.java
===================================================================
--- src/java/org/jivesoftware/spark/ui/VCardPanel.java	(revision 10980)
+++ src/java/org/jivesoftware/spark/ui/VCardPanel.java	(working copy)
@@ -10,6 +10,14 @@
 
 package org.jivesoftware.spark.ui;
 
+import org.jivesoftware.resource.SparkRes;
+import org.jivesoftware.smackx.packet.VCard;
+import org.jivesoftware.spark.SparkManager;
+import org.jivesoftware.spark.UserManager;
+import org.jivesoftware.spark.util.GraphicUtils;
+import org.jivesoftware.spark.util.ModelUtil;
+import org.jivesoftware.spark.util.log.Log;
+
 import java.awt.Color;
 import java.awt.Cursor;
 import java.awt.Desktop;
@@ -18,6 +26,7 @@
 import java.awt.GridBagLayout;
 import java.awt.Image;
 import java.awt.Insets;
+import java.awt.Point;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.io.IOException;
@@ -29,14 +38,8 @@
 import javax.swing.ImageIcon;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-
-import org.jivesoftware.resource.SparkRes;
-import org.jivesoftware.smackx.packet.VCard;
-import org.jivesoftware.spark.SparkManager;
-import org.jivesoftware.spark.UserManager;
-import org.jivesoftware.spark.util.GraphicUtils;
-import org.jivesoftware.spark.util.ModelUtil;
-import org.jivesoftware.spark.util.log.Log;
+import javax.swing.Popup;
+import javax.swing.PopupFactory;
 
 /**
  * UI to display VCard Information in Wizards, Dialogs, Chat Rooms and any other container.
@@ -45,7 +48,7 @@
  */
 public class VCardPanel extends JPanel {
 
-	private static final long serialVersionUID = -5810110243694315630L;
+    private static final long serialVersionUID = -5810110243694315630L;
 	private Cursor DEFAULT_CURSOR = new Cursor(Cursor.DEFAULT_CURSOR);
     private Cursor LINK_CURSOR = new Cursor(Cursor.HAND_CURSOR);
 
@@ -53,6 +56,9 @@
     private final JLabel avatarImage;
 
     private String emailAddress = "";
+    
+    private ImageIcon mouseOverImage = null;
+    private Popup avatarPopup = null;
 
     /**
      * Generate a VCard Panel using the specified jid.
@@ -84,7 +90,6 @@
         }
 
         ImageIcon icon = null;
-
         byte[] bytes = vcard.getAvatar();
         if (bytes != null && bytes.length > 0) {
             try {
@@ -90,7 +95,10 @@
             try {
                 icon = new ImageIcon(bytes);
                 Image newImage = icon.getImage();
-                newImage = newImage.getScaledInstance(-1, 48, Image.SCALE_SMOOTH);
+                mouseOverImage = icon;
+                
+                //newImage = newImage.getScaledInstance(-1, 48, Image.SCALE_SMOOTH);
+                newImage = newImage.getScaledInstance(-1, 32, Image.SCALE_SMOOTH);
                 icon = new ImageIcon(newImage);
             }
             catch (Exception e) {
@@ -105,7 +113,6 @@
             avatarImage.setIcon(icon);
             avatarImage.setBorder(BorderFactory.createBevelBorder(0, Color.white, Color.lightGray));
         }
-
         vcard.setJabberId(jid);
         buildUI(vcard);
     }
@@ -118,6 +125,38 @@
                     SparkManager.getVCardManager().viewProfile(vcard.getJabberId(), avatarImage);
                 }
             }
+            public void mouseEntered(MouseEvent mouseEvent){
+            	
+            	if(mouseOverImage != null){
+            		
+            		JLabel picture = new JLabel();
+                	picture.setIcon(mouseOverImage);
+                	ChatRoom room = null;
+    				try {
+    					room = SparkManager.getChatManager().getChatContainer().getActiveChatRoom();
+    				} catch (ChatRoomNotFoundException e) {
+    					// TODO Auto-generated catch block
+    					e.printStackTrace();
+    				}
+    				if(room != null){
+    				Point point = room.getLocationOnScreen();
+                	avatarPopup = PopupFactory.getSharedInstance().getPopup(room, picture, point.x - mouseOverImage.getIconWidth() - 10, point.y + 7);
+    				avatarPopup.show();
+    				}
+            	}else{
+            		
+            		//Do nothing
+            	}
+            	
+            }
+            public void mouseExited(MouseEvent e) {
+            	
+            	if(avatarPopup != null){
+            		
+            		avatarPopup.hide();
+            		avatarPopup = null;
+            	}
+            }
         });
 
         String firstName = vcard.getFirstName();
@@ -190,7 +229,7 @@
     }
 
     private void startEmailClient(String emailAddress) {
-   		try {
+    	try {
 			Desktop.getDesktop().mail(new URI("mailto:" + emailAddress));
 		} catch (IOException e) {
 			Log.error("Can't open Mailer", e);
@@ -197,8 +236,6 @@
 		} catch (URISyntaxException e) {
 			Log.error("URI Wrong", e);
 		}
-
-
     }
 
 
Index: src/java/org/jivesoftware/sparkimpl/preference/notifications/NotificationsUI.java
===================================================================
--- src/java/org/jivesoftware/sparkimpl/preference/notifications/NotificationsUI.java	(revision 10980)
+++ src/java/org/jivesoftware/sparkimpl/preference/notifications/NotificationsUI.java	(working copy)
@@ -66,7 +66,7 @@
         windowFocusBox.setSelected(popup);
     }
 
-    public boolean shouldWindowPopup() {
+   public boolean shouldWindowPopup() {
         return windowFocusBox.isSelected();
     }
 
Index: src/java/org/jivesoftware/sparkimpl/profile/VCardEditor.java
===================================================================
--- src/java/org/jivesoftware/sparkimpl/profile/VCardEditor.java	(revision 10980)
+++ src/java/org/jivesoftware/sparkimpl/profile/VCardEditor.java	(working copy)
@@ -111,7 +111,7 @@
         dlg.setModal(false);
 
         dlg.pack();
-        dlg.setSize(600, 400);
+        dlg.setSize(650, 650);
         dlg.setResizable(true);
         dlg.setContentPane(mainPanel);
         dlg.setLocationRelativeTo(parent);
@@ -344,7 +344,7 @@
             avatarPanel.setAvatar(icon);
             avatarPanel.setAvatarBytes(bytes);
             if (avatarLabel != null) {
-                icon = GraphicUtils.scaleImageIcon(icon, 48, 48);
+                //icon = GraphicUtils.scaleImageIcon(icon, 48, 48);
 
                 avatarLabel.setIcon(icon);
             }
@@ -396,10 +396,14 @@
 
         if (avatarFile != null) {
             try {
-                // Make it 48x48
+                // scale image
                 ImageIcon icon = new ImageIcon(avatarFile.toURI().toURL());
                 Image image = icon.getImage();
-                image = image.getScaledInstance(-1, 48, Image.SCALE_SMOOTH);
+                //scale the image if the height is bigger than 400
+                if(icon.getIconHeight() > 400){
+                
+                	image = image.getScaledInstance(-1, 400, Image.SCALE_SMOOTH);
+                }
                 avatarBytes = GraphicUtils.getBytesFromImage(image);
             }
             catch (MalformedURLException e) {
@@ -426,9 +430,9 @@
                 // Change my own presence
                 SparkManager.getSessionManager().changePresence(newPresence);
 
-                // Chnage avatar in status bar.
-                StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
-                statusBar.setAvatar(new ImageIcon(vcard.getAvatar()));
+                // Change avatar in status bar.
+                //StatusBar statusBar = SparkManager.getWorkspace().getStatusBar();
+                //statusBar.setAvatar(new ImageIcon(vcard.getAvatar()));
             }
             else {
                 String firstName = vcard.getFirstName();
@@ -444,7 +448,7 @@
                 statusBar.setAvatar(null);
             }
 
-            // Notify listenres
+            // Notify listeners
             SparkManager.getVCardManager().notifyVCardListeners();
         }
         catch (XMPPException e) {
Index: src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java
===================================================================
--- src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java	(revision 10980)
+++ src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java	(working copy)
@@ -324,7 +324,7 @@
                 byte[] bytes = personalVCard.getAvatar();
                 if (bytes != null && bytes.length > 0) {
                     ImageIcon icon = new ImageIcon(bytes);
-                    icon = VCardManager.scale(icon);
+                    //icon = VCardManager.scale(icon);
                     if (icon != null && icon.getIconWidth() != -1) {
                         BufferedImage image = GraphicUtils.convert(icon.getImage());
                         ImageIO.write(image, "PNG", imageFile);
@@ -350,7 +350,14 @@
         byte[] bytes = vcard.getAvatar();
         if (bytes != null && bytes.length > 0) {
             ImageIcon icon = new ImageIcon(bytes);
-            return GraphicUtils.scaleImageIcon(icon, 40, 40);
+            //return GraphicUtils.scaleImageIcon(icon, 40, 40);
+            
+            //scale the image if the height is bigger than 40
+            if(icon.getIconHeight() > 40){
+            
+            	icon = new ImageIcon(icon.getImage().getScaledInstance(-1, 40, Image.SCALE_SMOOTH));
+            }
+            return icon;
         }
         return null;
     }
@@ -419,8 +426,9 @@
                 if (vcard.getNickName() != null && vcard.getNickName().length() > 0)
                 {
                 	// update nickname.
-                	ContactItem item = SparkManager.getWorkspace().getContactList().getContactItemByJID(jid);
-                	item.setNickname(vcard.getNickName());
+                	//String nickname = vcard.getNickName();
+                	//ContactItem item = SparkManager.getWorkspace().getContactList().getContactItemByJID(jid);
+                	//item.setNickname(nickname);
                 	// TODO: this doesn't work if someone removes his nickname. If we remove it in that case, it will cause problems with people using another way to manage their nicknames.
                 }
                 vcards.put(jid, vcard);
@@ -489,8 +497,8 @@
      */
     public static ImageIcon scale(ImageIcon icon) {
         Image avatarImage = icon.getImage();
-        if (icon.getIconHeight() > 64 || icon.getIconWidth() > 64) {
-            avatarImage = avatarImage.getScaledInstance(-1, 64, Image.SCALE_SMOOTH);
+        if (icon.getIconHeight() > 200) {
+            avatarImage = avatarImage.getScaledInstance(-1, 200, Image.SCALE_SMOOTH);
         }
 
         return new ImageIcon(avatarImage);
Index: src/java/org/jivesoftware/sparkimpl/profile/AvatarPanel.java
===================================================================
--- src/java/org/jivesoftware/sparkimpl/profile/AvatarPanel.java	(revision 10980)
+++ src/java/org/jivesoftware/sparkimpl/profile/AvatarPanel.java	(working copy)
@@ -10,22 +10,6 @@
 
 package org.jivesoftware.sparkimpl.profile;
 
-import org.jivesoftware.resource.Res;
-import org.jivesoftware.spark.util.GraphicUtils;
-import org.jivesoftware.spark.util.ResourceUtils;
-import org.jivesoftware.spark.util.SwingWorker;
-import org.jivesoftware.spark.util.URLFileSystem;
-import org.jivesoftware.spark.util.log.Log;
-
-import javax.swing.BorderFactory;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dialog;
@@ -40,6 +24,23 @@
 import java.io.FilenameFilter;
 import java.io.IOException;
 
+import javax.swing.BorderFactory;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+
+import org.jivesoftware.resource.Res;
+import org.jivesoftware.spark.util.GraphicUtils;
+import org.jivesoftware.spark.util.ResourceUtils;
+import org.jivesoftware.spark.util.SwingWorker;
+import org.jivesoftware.spark.util.URLFileSystem;
+import org.jivesoftware.spark.util.log.Log;
+
 /**
  * UI to view/edit avatar.
  */
@@ -58,10 +59,8 @@
      */
     public AvatarPanel() {
         setLayout(new GridBagLayout());
-
-
         final JLabel photo = new JLabel("Avatar:");
-
+        JTextArea infoText = new JTextArea(Res.getString("info.avatar.image"));
         avatar = new JLabel();
 
         add(photo, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
@@ -68,7 +67,8 @@
         add(avatar, new GridBagConstraints(1, 0, 1, 2, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
         add(browseButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
         add(clearButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
-
+        add(infoText, new GridBagConstraints(1, 2, 2, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
+        
         browseButton.addActionListener(this);
 
         // Add ResourceUtils
@@ -106,8 +106,9 @@
      */
     public void setAvatar(ImageIcon icon) {
         avatar.setBorder(BorderFactory.createBevelBorder(0, Color.white, Color.lightGray));
-        if (icon.getIconHeight() > 64 || icon.getIconWidth() > 64) {
-            avatar.setIcon(new ImageIcon(icon.getImage().getScaledInstance(-1, 64, Image.SCALE_SMOOTH)));
+        // max height is 400, if bigger then scale
+        if (icon.getIconWidth() > 400) { 
+            avatar.setIcon(new ImageIcon(icon.getImage().getScaledInstance(-1, 400, Image.SCALE_SMOOTH)));
         }
         else {
             avatar.setIcon(icon);
@@ -181,9 +182,9 @@
                 try {
                     ImageIcon imageOnDisk = new ImageIcon(selectedFile.getCanonicalPath());
                     Image avatarImage = imageOnDisk.getImage();
-                    if (avatarImage.getHeight(null) > 96 || avatarImage.getWidth(null) > 96) {
+                    /*if (avatarImage.getHeight(null) > 96 || avatarImage.getWidth(null) > 96) {
                         avatarImage = avatarImage.getScaledInstance(-1, 96, Image.SCALE_SMOOTH);
-                    }
+                    }*/
                     return avatarImage;
                 }
                 catch (IOException ex) {
@@ -286,7 +287,6 @@
         this.dlg = dialog;
     }
 
-
 }

