rem: height = actualHeight * (gPreviewImageWidth / actualWidth); 
add: height = gActualHeight * (gPreviewImageWidth / gActualWidth); 
context: function PreviewImageLoaded(){  if (gDialog.PreviewImage)  {    // Image loading has completed -- we can get actual width    actualWidth  = gDialog.PreviewImage.naturalWidth;    actualHeight = gDialog.PreviewImage.naturalHeight;    if (actualWidth && actualHeight)    {      // Use actual size or scale to fit preview if either dimension is too large      var width = actualWidth;      var height = actualHeight;      if (actualWidth > gPreviewImageWidth)      {          width = gPreviewImageWidth;          height = actualHeight * (gPreviewImageWidth / actualWidth);      }      if (height > gPreviewImageHeight)      {        height = gPreviewImageHeight;        width = actualWidth * (gPreviewImageHeight / actualHeight);      }      gDialog.PreviewImage.width = width;      gDialog.PreviewImage.height = height;      gDialog.PreviewWidth.setAttribute("value", actualWidth);      gDialog.PreviewHeight.setAttribute("value", actualHeight);      gDialog.PreviewSize.setAttribute("collapsed", "false");      gDialog.ImageHolder.setAttribute("collapsed", "false");      // Use values as start for constrain proportions    }    if (gDialog.actualSizeRadio.selected)      SetActualSize();  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/6ff254ec3a2c3d4e6e690535f65f89a007c66b98/EdImageOverlay.js/buggy/editor/ui/dialogs/content/EdImageOverlay.js