We're using GlassMapper 4.0.5.54 in Sitecore 8.1 Update 1 MVC. The problem is, when rendering an ImageField, the height and width attributes are written in the img-tag - but only in Page Editor mode.
We tried different approaches like
@Html.Glass().RenderImage(Model, x=> x.ImageField, outputHeightWidth:false, isEditable:true, parameters:new {mw = 1218, mh = 530})
@Html.Glass().Editable(x => x.ImageField, new { mw = 1218, mh = 530, width = (string)null, height = (string)null })
But we always get
<img src="http://url_to_local_website/-/media/image_1218x530.jpg?h=530&la=en&mh=530&mw=1218&w=1216&hash=452505F9D5896956CB6B0F284755555217E62D8A" alt="Alt Text" width="1216" height="530" sc-part-of="field" class="scEnabledChrome">
So even when using the explicit parameter outputHeightWidth:false
it outputs width and height attributes in Page Editor and distorts the image. Any suggestions? Or is it a bug?
In a comment on Glass Mapper ImageParameters someone else mentions the same behavior. But there is no answer to it.