bumptech / glide

An image loading and caching library for Android focused on smooth scrolling
https://bumptech.github.io/glide/
Other
34.67k stars 6.12k forks source link

Glide not loading Image from redirect link #3251

Closed tobioyelekan closed 6 years ago

tobioyelekan commented 6 years ago

I use Glide for loading images which works fine, until i used a url that redirects to another one. please how do i solve this? thank you.

Original link: https://images.copart.com/website/data/pix/20061226/41288898_1X

Redirected link: http://cs.copart.com/v1/AUTH_svc.pdoc00001/PIX133/a74f8b3d-9c6b-4af9-8975-393e648dab8c.JPG

code for downloading image:

Glide.with(context).load(img_end_point + car.get(position).getImageName()).
            override(Target.SIZE_ORIGINAL, 200).fitCenter()
            .listener(new RequestListener<String, GlideDrawable>() {
                @Override
                public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) {
                    loader.setVisibility(View.GONE);
                    e.printStackTrace();
                    return false;
                }

                @Override
                public boolean onResourceReady(GlideDrawable resource, String model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) {
                    loader.setVisibility(View.GONE);
                    return false;
                }
            })
            .into(imageView);

error:

BasicNetwork.performRequest: Unexpected response code 301 for https://images.copart.com/website/data/pix/20061226/39879168_1X java.util.concurrent.ExecutionException: com.android.volley.ServerError com.bumptech.glide.integration.volley.VolleyRequestFuture.doGet(VolleyRequestFuture.java:125) com.bumptech.glide.integration.volley.VolleyRequestFuture.get(VolleyRequestFuture.java:92) com.bumptech.glide.integration.volley.VolleyStreamFetcher.loadData(VolleyStreamFetcher.java:68) com.bumptech.glide.integration.volley.VolleyStreamFetcher.loadData(VolleyStreamFetcher.java:21) com.bumptech.glide.load.model.ImageVideoModelLoader$ImageVideoFetcher.loadData(ImageVideoModelLoader.java:70) com.bumptech.glide.load.model.ImageVideoModelLoader$ImageVideoFetcher.loadData(ImageVideoModelLoader.java:53) com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:170) com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128) com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:106) com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58) java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) java.util.concurrent.FutureTask.run(FutureTask.java:237) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) java.lang.Thread.run(Thread.java:761) com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(F foPriorityThreadPoolExecutor.java:118) com.android.volley.ServerError com.android.volley.toolbox.BasicNetwork.performRequest(BasicNetwork.java:163) com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:112)

sjudd commented 6 years ago

What version of Glide are you using? Are you using the Volley integration library?

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.

abrihamdemisse commented 10 months ago

it is occurring still