Merge pull request #220 from Gordon-Beeming/FixBase64ImageDownload
added code to not attempt to download base64 embeded images
This commit is contained in:
commit
59efc85f6b
|
@ -232,6 +232,10 @@ namespace OpenLiveWriter.CoreServices
|
||||||
/// <param name="progressHost">The progressHost to provide feedback to</param>
|
/// <param name="progressHost">The progressHost to provide feedback to</param>
|
||||||
private void DownloadReference(ReferenceToDownload reference, FileBasedSiteStorage fileStorage, IProgressHost progressHost)
|
private void DownloadReference(ReferenceToDownload reference, FileBasedSiteStorage fileStorage, IProgressHost progressHost)
|
||||||
{
|
{
|
||||||
|
if (IsBase64EmbededImage(reference.AbsoluteUrl))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
UrlDownloadToFile downloader;
|
UrlDownloadToFile downloader;
|
||||||
string fullPath;
|
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>
|
/// <summary>
|
||||||
/// Used to actually commit the HTML to disk
|
/// Used to actually commit the HTML to disk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue