title: Load a Image from an Url to an Image View
body: <p>I am developing an Android app for which I am working with an API.</p>
  
  <p>The API is returning certain results such as an URL of an Image.</p>
  
  <p>Since I have always been using Glide library to load offline and online images to an ImageView so for this also I am using the Glide Library. </p>
  
  <p>But the problem this time is that sometimes the url which is returned through an API is not returning an Image file but is returning a normmal file only. I mean that if I paste that url in an web browser then the file which is being downloaded is not in an Image form but just in an file form. Hence when I try to use that url with the Glide library it is not working.</p>
  
  <p>But after downloading if I change the extension of the file to an image extension then the file is being opened properly as an image.</p>
  
  <p>Any help on how a url which is returning a general file can be used to show an image would be really helpful.</p>
  
  <p>This is how I am using the Glide Library</p>
  
  <pre><code>Glide.with(context.getApplicationContext())
                  .load(GetImageUrl())
                  .asBitmap()
                  .listener(new RequestListener&lt;String, Bitmap&gt;() {
                      @Override
                      public boolean onException(Exception e, String model, Target&lt;Bitmap&gt; target, boolean isFirstResource) {
                          return false;
                      }
  
                      @Override
                      public boolean onResourceReady(Bitmap resource, String model, Target&lt;Bitmap&gt; target, boolean isFromMemoryCache, boolean isFirstResource) {
  
                          return false;
                      }
                  })
                  .diskCacheStrategy(DiskCacheStrategy.RESULT)
                  .thumbnail(0.5f)
                  .into(image);
  </code></pre>