Merge pull request #220 from Gordon-Beeming/FixBase64ImageDownload

added code to not attempt to download base64 embeded images
This commit is contained in:
Martin Woodward 2015-12-23 08:12:26 +00:00
commit 59efc85f6b
1 changed files with 10 additions and 0 deletions

View File

@ -232,6 +232,10 @@ namespace OpenLiveWriter.CoreServices
/// <param name="progressHost">The progressHost to provide feedback to</param>
private void DownloadReference(ReferenceToDownload reference, FileBasedSiteStorage fileStorage, IProgressHost progressHost)
{
if (IsBase64EmbededImage(reference.AbsoluteUrl))
{
return;
}
UrlDownloadToFile downloader;
string fullPath;
@ -346,6 +350,12 @@ namespace OpenLiveWriter.CoreServices
}
}
private bool IsBase64EmbededImage(string url)
{
return url.StartsWith("data:image/", StringComparison.InvariantCultureIgnoreCase) &&
url.ToLowerInvariant().Contains("base64");
}
/// <summary>
/// Used to actually commit the HTML to disk
/// </summary>