AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.8" />

 ImageRequestProcessor

For more information, see: http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#update-the-image-data
using AngleSharp.Dom; using AngleSharp.Services; using AngleSharp.Services.Media; using System.Threading; using System.Threading.Tasks; namespace AngleSharp.Network.RequestProcessors { internal sealed class ImageRequestProcessor : ResourceRequestProcessor<IImageInfo> { public int Width { get { if (!base.IsReady) return 0; return base.Resource.Width; } } public int Height { get { if (!base.IsReady) return 0; return base.Resource.Height; } } private ImageRequestProcessor(IConfiguration options, IResourceLoader loader) : base(options, loader) { } internal static ImageRequestProcessor Create(Element element) { Document owner = element.Owner; IConfiguration options = owner.Options; IResourceLoader loader = owner.Loader; if (options == null || loader == null) return null; return new ImageRequestProcessor(options, loader); } protected override async Task ProcessResponseAsync(IResponse response) { IResourceService<IImageInfo> service = GetService(response); if (service != null) { CancellationToken none = CancellationToken.None; IImageInfo imageInfo2 = Resource = await service.CreateAsync(response, none).ConfigureAwait(false); } } } }