Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments from SharePoint to Word.
MIT License
297
stars
106
forks
source link
ImagePrefetcher doesn't actually cache the images #118
public HtmlImageInfo Download(string imageUri)
{
if (prefetchedImages.Contains(imageUri))
return prefetchedImages[imageUri];
if (DataUri.IsWellFormed(imageUri)) // data inline, encoded in base64
{
return ReadDataUri(imageUri);
}
return DownloadRemoteImage(imageUri);
}
As you can see, it checks the cache for existing imageUri, but never adds to it so it will always fetch images and possibly create duplicate image parts.
The ImagePrefetcher.cs has the following method
As you can see, it checks the cache for existing imageUri, but never adds to it so it will always fetch images and possibly create duplicate image parts.