Полезный код.
private enum ImageSize
{
Thumbnail,
Large,
Full
}
private string GetResizedImageUrl(SPListItem listItem, ImageSize imageSize)
{
StringBuilder url = new StringBuilder();
url.Append(SPEncode.UrlEncodeAsUrl(listItem.Web.Url));
url.Append('/');
url.Append(SPEncode.UrlEncodeAsUrl(listItem.ParentList.RootFolder.Url));
url.Append('/');
string filename = listItem.File.Name;
if (imageSize == ImageSize.Full)
{
url.Append(SPEncode.UrlEncodeAsUrl(filename));
}
else
{
string basefilename = Path.GetFileNameWithoutExtension(filename);
string extension = Path.GetExtension(filename);
string dir = (imageSize == ImageSize.Thumbnail) ? "_t/" : "_w/";
url.Append(dir);
url.Append(SPEncode.UrlEncodeAsUrl(basefilename));
url.Append(SPEncode.UrlEncodeAsUrl(extension).Replace('.', '_'));
url.Append(".jpg");
}
return url.ToString();
}