Index: /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2819)
+++ /CKEditor/branches/prototype/_source/plugins/image/dialogs/image.js	(revision 2820)
@@ -281,6 +281,32 @@
 			btnLockSizes.addClass( 'BtnUnlocked' );
 
-		//TODO: read styles
-		
+		// Read styles.
+		var aMatchW  =  dialog.editObj[ 'image' ].$.style.width.match( regexSize );
+		if ( aMatchW )
+		{
+			// % is allowed.
+			if ( aMatchW[2] == '%' )
+			{
+				aMatchW[1] += '%';
+				switchLockRatio( dialog, false );	// Unlock ratio
+			}
+			widthText = aMatchW[1];
+			dialog.changedAttibutes[ 'image' ][ 'width' ] = widthText;
+			dialog.dimensionsInStyle[ 'width' ] = true;
+		}
+		var aMatchH  =  dialog.editObj[ 'image' ].$.style.height.match( regexSize );
+		if ( aMatchH )
+		{
+			// % is allowed.
+			if ( aMatchH[2] == '%' )
+			{
+				aMatchH[1] += '%';
+				switchLockRatio( dialog, false );	// Unlock ratio
+			}
+			heightText = aMatchH[1];
+			dialog.changedAttibutes[ 'image' ][ 'height' ] = heightText;
+			dialog.dimensionsInStyle[ 'height' ] = true;
+		}
+
 		var allow = dialog.allowOnChange;
 		dialog.allowOnChange = false;
@@ -391,5 +417,5 @@
 			if ( this.editMode[ 'image' ] )
 			{
-				var imgTagName = this.editObj[ 'image' ].$.tagName.toLowerCase();
+				var imgTagName = this.editMode[ 'image' ];
 
 				// Image dialog and Input element.
@@ -434,4 +460,10 @@
 			this.editObj[ 'image' ].setAttributes( this.changedAttibutes[ 'image' ] );
 
+			// Set STYLE dimensions.
+			if ( this.dimensionsInStyle[ 'width' ] == true )
+				this.editObj[ 'image' ].setStyle( 'width',  this.changedAttibutes[ 'image' ][ 'width' ] + 'px' );
+			if ( this.dimensionsInStyle[ 'height' ] == true )
+				this.editObj[ 'image' ].setStyle( 'height',  this.changedAttibutes[ 'image' ][ 'height' ] + 'px' );
+
 			// Set link attributes.
 			this.changedAttibutes[ 'link' ][ 'href' ] =  'javascript:void(0)/*' + CKEDITOR.tools.getNextNumber() + '*/';
@@ -498,4 +530,7 @@
 
 			this.imageLockRatio = true;
+			this.dimensionsInStyle = new Array();
+			this.dimensionsInStyle[ 'width' ] = false;
+			this.dimensionsInStyle[ 'height' ] = false;
 
 			// IE BUG: Selection must be in the editor for getSelection() to work.
