Skip to content Skip to sidebar Skip to footer

Loading Images By Glide Spoil Image Quality

I build simple gallery. I load my photos using Glide. It looks like on images loaded by glide is some kind of streak (pixels seems to be visible). I tried to load photo with chang

Solution 1:

To load the original image using Glide I use the code below:

  Glide.with(view.getContext())
                    .load(pictureFile)
                    .asBitmap()
                    .into(new SimpleTarget<Bitmap>(Target.SIZE_ORIGINAL,Target.SIZE_ORIGINAL) {
                        @Override
                        public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
                            imageView.setImageBitmap(resource);
                        }
                    });

Remember that the picture in browser may look different on the device due to the screen resolution of your device. Using this method you will be able to check the pixels using the Bitmap object. Also, keep in mind that your ImageView must have width and height with WRAP_CONTENT value.

Solution 2:

Please try this one:

android:layout_width="match_parent"android:layout_height="wrap_content"android:adjustViewBounds="true"android:layout_margin="2dp"

Imageview property set android:adjustViewBounds="true"

Post a Comment for "Loading Images By Glide Spoil Image Quality"