I'm using the Composite C1 CMS v4.2 Update 1. In some of my pages which make use of the Media section and some programmatic image population from the Media section I periodically get a width and height of 0 for all images that come out of the Media section unless I specifically enter the width and height of the images. Below is an example of the programmatically populated images. I suppose I could try and populate the height and width through the code, but Composite C1 appears to do that using the MediaURL() method below, it just happens to be making them 0 in some cases. In the CMS Content section, when I specifically add the height and width it works fine, however there is no height and width dialog in the WYSIWYG Image properties so you are forced to go into the source and edit the IMG tag manually. Hopefully I'm doing something seriously wrong here because this seems like it's going to be a problem for us.
@{
string folderPath = CurrentPageNode.Url.Substring(10).Replace("/","_");
folderPath = "/" + folderPath;
var images = Data.Get<IImageFile>().Where(image => image.FolderPath == folderPath).OrderBy(image => image.FileName).ToList();
string cssClass = "";
}
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://www.composite.net/ns/function/1.0">
<head>
</head>
<body>
<div class="row">
@foreach (var image in images)
{
if (image.FileName.Length > 11 && image.FileName.ToLower().Substring(0,11) == "application")
{
cssClass = image.FileName.Substring(image.FileName.IndexOf("_")+1).Replace(".png","");
<div class="col-md-12">
<div class="application">
<a href="@image.Description">
<img src="@Html.C1().MediaUrl(image)" alt="@image.Title" />
</a>
<a href="@image.Description">
<div class="squareText @cssClass">@image.Title</div>
</a>
</div>
</div>
}
}
</div>
</body>