android Glide 4.0图片加载失败

项目中查看大图,并可以拖拽缩放,但是在加载图片等时候有些图片不能加载出来,报了一个错误:
class com.bumptech.glide.load.engine.GlideException: Failed to load resource

原因:DragPhotoView图片在加载的时候进行了缩放,导致图片失帧,不能加载,
解决方法:必须是加载原图
//加载原图的操作
RequestOptions options = new RequestOptions().override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL);
Glide.with(getBaseContext())
        .load(url)
        .apply(options)
        .listener(new RequestListener() {
            @Override
            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) {
                LogUtils.e("" + e.getMessage());
                LogUtils.e("model》》》" + model);
                return false;
            }

            @Override
            public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) {
                return false;
            }
        }).into(dragPhotoView);

你可能感兴趣的:(知识点记录,Glide,4.0图片加载失败)