title: WPF Can't retrieve WebP image from url?
body: <p>I'm unable to retrieve an image from a url. Previously I was unable to connect to the site at all until I set HttpClient headers. I'm able to retrieve images from other sources but not this particular one.</p>
  
  <p>Code for retrieving image:</p>
  
  <pre><code>var img = new BitmapImage();
          img.BeginInit();
          img.UriSource = new Uri("https://i1.adis.ws/i/jpl/jd_083285_a?qlt=80&amp;w=600&amp;h=425&amp;v=1&amp;fmt=webp", UriKind.RelativeOrAbsolute);
          img.EndInit();
          Console.Out.WriteLine();
          ImageShoe.Source = img;
  </code></pre>
  
  <p>If I try to retrieve a different image using a different url, for example <a href="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" rel="nofollow noreferrer">https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png</a> it works fine.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Seems that using a byte array is the way to go but I'm still not sure what is wrong here.</p>
  
  <pre><code>        HttpClient client = new HttpClient();
          client.DefaultRequestHeaders.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8");
          var url = "https://i1.adis.ws/i/jpl/jd_083285_a?qlt=80&amp;w=600&amp;h=425&amp;v=1&amp;fmt=webp";//baseUrl + productUrl;
          var result = await client.GetByteArrayAsync(new Uri(
          MemoryStream buf = new MemoryStream(result);
          var image = new BitmapImage();
          image.StreamSource = buf;
          this.ImageShoe.Source = image;
  </code></pre>