0

This is NOT the same as my previous question same error

This is the url https://www.walgreens.com/images/adaptive/share/images/logos/Mobile_Logo_DD.png wallgreens (this is an example of several which cause the same exception.

I monitor the session with fiddler and it correctly sees the image (it was not compressed). Maybe of interest is Content-Type: image\webp ?

The stream I am using is at the beginning.

In addition to the exception "No imagining component..." there is also an inner exception of "The Component cannot be found"

I am using the following to download the icon

using (HttpWebResponse response = GetHttpWebResponse(faviconUrl))
{
    if (response?.StatusCode == HttpStatusCode.OK)
    {
        using (Stream stream = GetSeekableStream(response.GetResponseStream()))
        {
            imageSource = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
        }
    }
}
  • 1
    Obviously WPF does not support `image/webp`. – Clemens Nov 13 '17 at 18:01
  • seems like I can change the UserAgent in the request to prevent the server from sending webp images. –  Nov 13 '17 at 21:51
  • 1
    Or try to set the [Accept](https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.accept.aspx) property – Clemens Nov 13 '17 at 23:02

0 Answers0