Subtext.Framework.Format.UrlFormats.GetImageFullUrl C# (CSharp) Method

GetImageFullUrl() public static method

Get the fully qualified url for an image for a given url to the image. The given url could be fully qualified, or some type of local url.
public static GetImageFullUrl ( string imageUrl ) : string
imageUrl string url to an image
return string
        public static string GetImageFullUrl(string imageUrl)
        {
            /// Examples of some fully qualified URLs:
            /// http://somehost.com/Subtext.Web/images/somehost_com/Subtext_Web/blog/8/pic.jpg
            /// http://thathost.net/Subtext.Web/images/thathost_net/Subtext_Web/4/picture.jpg
            /// http://fooHost.org/images/fooHost_org/myBlog/2/bar.jpg
            /// http://barHost.edu/images/
            ///
            /// Examples of some local URLs:
            ///		/Subtext.Web/images/somehost_com/Subtext_Web/blog/8/pic.jpg
            ///		/Subtext.Web/images/thathost_net/Subtext_Web/4/picture.jpg
            ///		/images/fooHost_org/myBlog/2/bar.jpg
            ///		/images/barHost_edu/7/that.jpg

            // First see if already have a full url
            if(!imageUrl.StartsWith("http"))
            {
                // it's not a full url, so it must by some type of local url
                // so add the siteRoot in front of it.
                imageUrl = StripSurroundingSlashes(imageUrl);
                imageUrl = string.Format("http://{0}/{1}", Config.CurrentBlog.Host, imageUrl) ;
            }
            return imageUrl ;
        }