天天看点

Glide加载同一URL图片问题

使用Glide加载图片时,图片大小第一次显示不正确,先打开一个图A,再打开一个图B,此时B图显示宽高是A的宽高,再次显示时不正确

public static void loadImageWithUrl(Context context, String urlPath, final ImageView imageView)
    {
        Log.info(TAG, "  loadImageThumbnailFromUrl urlPath=" + urlPath);
        Glide.with(context)
                .load(urlPath)
                .skipMemoryCache(true)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .thumbnail(0.5f)
                .dontAnimate()
                .into(new SimpleTarget<GlideDrawable>()//关键代码
                {
                    @Override
                    public void onResourceReady(GlideDrawable resource,
                                                GlideAnimation<? super GlideDrawable> glideAnimation)
                    {
                        imageView.setImageDrawable(resource);
                    }
                });
    }
           

https://blog.csdn.net/tiramisu_ljh/article/details/70885744

https://github.com/bumptech/glide/issues/624

https://github.com/bumptech/glide/issues/1117

http://bumptech.github.io/glide/javadocs/470/com/bumptech/glide/signature/ObjectKey.html

https://blog.csdn.net/carson_ho/article/details/79256773

https://blog.csdn.net/carson_ho/article/details/79256892

Glide4.5.0

java.io.FileNotFoundException(No content provider: http://192.168.0.101:8085\file\avatar\10002\1d72eb690843494cbbfb11c3549967e2.jpg

原因:未知

不过小编将路径中的\改为/后,可以正常加载了,猜测和路径反斜杠有关

windows系统中获取的路径为,所以服务放到windows中时有异常。解决办法将代码中的

File.separator 改为 “/”

Gilde刷新图片闪烁和You must not call setTag() on a view Glide is targeting如何解决

https://blog.csdn.net/u010899537/article/details/74394642

Error “You must not call setTag() on a view Glide is targeting” when use Glide

https://stackoverflow.com/questions/34833627/error-you-must-not-call-settag-on-a-view-glide-is-targeting-when-use-glide

https://blog.csdn.net/FlyingMonkeyR/article/details/77834111

https://blog.csdn.net/qq_38373150/article/details/79694726?utm_source=blogxgwz6 Glide获取视频某一帧

https://blog.csdn.net/huangxiaoguo1/article/details/76552889 如何获取网络视频(或者说后台返回视频URL)第一帧图片以及获取本地视频的第一帧图片

https://www.jianshu.com/p/5ac525a6f010 glide加载图片,视频缩略图,gif图片

https://www.jianshu.com/p/2cd93bc55d1a Glide加载gif及本地视频缩略图的坑

https://blog.csdn.net/u012947056/article/details/78508986

继续阅读