title: Glide fails to load resources when trying to load an image from a URL
body: <p>i use glide to load image into Drawable object. When i try to load local image, it works fine. But, i switch to image from url, it won't work and i get this error message : </p>
  
  <pre><code>W/Glide: Load failed for https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png with size [-2147483648x-2147483648]
      class com.bumptech.glide.load.engine.GlideException: Failed to load resource
        Cause (1 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer-&gt;Object-&gt;Drawable}, DATA_DISK_CACHE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;GifDrawable-&gt;Drawable}
          Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;Bitmap-&gt;Drawable}
          Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;BitmapDrawable-&gt;Drawable}
        Cause (2 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream-&gt;Object-&gt;Drawable}, DATA_DISK_CACHE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;GifDrawable-&gt;Drawable}
          Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;Bitmap-&gt;Drawable}
          Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;BitmapDrawable-&gt;Drawable}
        Cause (3 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor-&gt;Object-&gt;Drawable}, DATA_DISK_CACHE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor-&gt;Bitmap-&gt;Drawable}
            Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
          Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor-&gt;BitmapDrawable-&gt;Drawable}
            Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
        Cause (4 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer-&gt;Object-&gt;Drawable}, REMOTE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;GifDrawable-&gt;Drawable}
          Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;Bitmap-&gt;Drawable}
          Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer-&gt;BitmapDrawable-&gt;Drawable}
        Cause (5 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream-&gt;Object-&gt;Drawable}, REMOTE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;GifDrawable-&gt;Drawable}
          Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;Bitmap-&gt;Drawable}
          Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream-&gt;BitmapDrawable-&gt;Drawable}
        Cause (6 of 6): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor-&gt;Object-&gt;Drawable}, REMOTE, https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png
          Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor-&gt;Bitmap-&gt;Drawable}
            Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
          Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor-&gt;BitmapDrawable-&gt;Drawable}
            Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
  </code></pre>
  
  <p>And here is my error stack trace : </p>
  
  <pre><code> Caused by: java.lang.RuntimeException: setDataSource failed: status = 0x80000000
      at android.media.MediaMetadataRetriever.setDataSource(Native Method)
      at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:144)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:128)
      at com.bumptech.glide.load.resource.bitmap.VideoBitmapDecoder.decode(VideoBitmapDecoder.java:25) 
      ..... .... ...
      at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:72) 
      at com.bumptech.glide.load.engine.DataCacheGenerator.startNext(DataCacheGenerator.java:71) 
      at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:303) 
      at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:270) 
      at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:234) 
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
      at java.lang.Thread.run(Thread.java:818) 
      at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:445) 
  </code></pre>
  
  <p>Above is my error trace, i debug it in callback.
  Here is my implementation : </p>
  
  <pre><code>Glide.with(context)
      .load("https://www.dropbox.com/s/nx8ufy3jxc9urgv/ic_reward_3rb.png")
      .into(object : SimpleTarget&lt;Drawable&gt;() {
          override fun onResourceReady(downloadedResource: Drawable, transition: Transition&lt;in Drawable&gt;) {
              Log.e("GameRejeki", "Resource is Ready...")
              downloadedResource.setBounds(
                      leftSize + leftSize / 2 - rewardIconWidth / 3,
                      topSize,
                      widthSize + leftSize / 2 - rewardIconWidth / 3,
                      heightSize
              )
  
              canvas.save()
              canvas.rotate(value, leftSize.toFloat(), leftSize.toFloat())
              downloadedResource.draw(canvas)
              canvas.restore()
          }
      })
  </code></pre>