public static string GetThumbPath(string path, ThumbSize size, string extension = null) { if (string.IsNullOrEmpty(path)) { return(null); } FileInfo inf = new FileInfo(path); return(size.ToString().ToLower() + "\\" + inf.Name.GetBeforeLast(".") + (extension ?? inf.Extension)); }
public static string GetThumbUrl(string path, ThumbSize size, string extension = null) { if (string.IsNullOrEmpty(path)) { return(null); } FileInfo inf = new FileInfo(path); string name = inf.Name.GetBeforeLast(".") + (extension ?? inf.Extension); string url = inf.Directory.FullName.Replace(Shell.AppRootPath + "\\", ""); url = url.Replace(Shell.PublicRoot + "\\", ""); return(Utils.CombineUrl(url, size.ToString().ToLower(), name)); }
public string GetThumbSize() { return(ThumbSize.ToString().ToLower()); }