public string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
        {
            var sizeValue = string.Format("{0}x{1}", size.Width, size.Height);

            return(string.Format(ServiceFormatUrl, Url, sizeValue,
                                 Url.GetHashCode()));
        }
        public static string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
        {
            var imageUrl = ThumbnailHelper.Instance.GetThumbnailUrl(Url, size);

            return(!String.IsNullOrEmpty(imageUrl)
                       ? imageUrl
                       : WebImageSupplier.GetAbsoluteWebPath(BookmarkingRequestConstants.NoImageAvailable, BookmarkingSettings.ModuleId));
        }
 public static string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
 {
     try
     {
         var uri      = new Uri(Url);
         var imageUrl = ThumbnailHelper.Instance.GetThumbnailUrl(HttpUtility.UrlEncode(uri.OriginalString), size);
         return(!String.IsNullOrEmpty(imageUrl)
                    ? imageUrl
                    : WebImageSupplier.GetAbsoluteWebPath(BookmarkingRequestConstants.NoImageAvailable, BookmarkingSettings.ModuleId));
     }
     catch (Exception)
     {
         return(WebImageSupplier.GetAbsoluteWebPath(BookmarkingRequestConstants.NoImageAvailable, BookmarkingSettings.ModuleId));
     }
 }
        public string GetThumbnailUrlForUpdate(string Url, BookmarkingThumbnailSize size)
        {
            var url = GetThumbnailUrl(Url, size);

            try
            {
                var req  = WebRequest.Create(url);
                var resp = (HttpWebResponse)req.GetResponse();
                if (resp.StatusCode == HttpStatusCode.OK)
                {
                    return(url);
                }
            }
            catch (Exception)
            {
            }
            return(null);
        }
        private static string GetFileNameByUrl(string url, BookmarkingThumbnailSize size)
        {
            string sizeString = size == null ? string.Empty : size.ToString();

            return(string.Format("{0}{1}.{2}", GetSHA256(url), sizeString, BookmarkingSettings.CaptureImageFormat.ToString()));
        }
 public string GetThumbnailUrlForUpdate(string Url, BookmarkingThumbnailSize size)
 {
     return(GetThumbnailUrl(Url, size));
 }
        public string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
        {
            var fileName = GetFileNameByUrl(Url, size);

            return(getStore(HttpContext.Current).IsFile(string.Empty, fileName) ? getStore(HttpContext.Current).GetUri(string.Empty, fileName).ToString() : string.Empty);
        }
 public string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
 {
     return(string.Format("/thumb.ashx?url={0}", Url));
 }
 public string GetThumbnailUrl(string Url, BookmarkingThumbnailSize size)
 {
     return(null);
 }
Example #10
0
 private string GetThumbnailUrl(BookmarkingThumbnailSize size)
 {
     return(BookmarkingServiceHelper.GetThumbnailUrl(URL, size));
 }