Issue 1:
Thanks for reading!

I will show something to intro this issue.

I have test two images:

image one
original size 157 × 266

image two
original size 3264 × 2448

Test One:

layout

<ImageView
android:id="@+id/photoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerInside"
android:background="#2aa0a6"/>

code

Glide.with(getActivity())
.load(path)
.asBitmap()
.into(new BitmapImageViewTarget(mPhotoView) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
super.onResourceReady(resource, glideAnimation);
Log.e("Glide Test", "imageView scaleType=centerInside"
+ " width=" + mPhotoView.getWidth()
+ " height=" + mPhotoView.getHeight() + ", "
+ " onResourceReady:"
+ " bitmap width=" + resource.getWidth()
+ " height=" + resource.getHeight());
}
});

test result log

image one
08-21 12:00:44.192 10260-10260/im.varicom.colorful E/Glide Test﹕ imageView scaleType=centerInside width=1080 height=1920, onResourceReady: bitmap width=157 height=226
image two
08-21 12:00:44.414 10260-10260/im.varicom.colorful E/Glide Test﹕ imageView scaleType=centerInside width=1080 height=1920, onResourceReady: bitmap width=3264 height=2448

My conclusion:

the image one's width and height both smaller than the imageView size, it is show normally.

the image two's width and height both larger than the imageView size, the result bitmap width and height is the original size. I think it is not the right way!

it let waste a lot of memory and let load the big image slower,

if the image show in ViewPager, scroll will not smooth.

(I think the best way is let result bitmap size not larger than the imageView size when the image size larger than the imageView size)

Test Two:

layout

<ImageView
android:id="@+id/photoView"
android:layout_width="200dp"
android:layout_height="200dp"
android:scaleType="centerInside"
android:layout_centerInParent="true"
android:background="#2aa0a6"/>

code

Glide.with(getActivity())
.load(path)
.asBitmap()
.into(new BitmapImageViewTarget(mPhotoView) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
super.onResourceReady(resource, glideAnimation);
Log.e("Glide Test", "imageView scaleType=centerInside"
+ " width=" + mPhotoView.getWidth()
+ " height=" + mPhotoView.getHeight() + ", "
+ " onResourceReady:"
+ " bitmap width=" + resource.getWidth()
+ " height=" + resource.getHeight());
}
});

test result log

image one
08-21 12:42:30.365 8109-8109/im.varicom.colorful E/Glide Test﹕ imageView scaleType=centerInside width=600 height=600, onResourceReady: bitmap width=157 height=226

image two
08-21 12:42:30.364 8109-8109/im.varicom.colorful E/Glide Test﹕ imageView scaleType=centerInside width=600 height=600, onResourceReady: bitmap width=816 height=612

My conclusion:

When the imageView size change, the image which width and height both smaller than the imageView size, it will show normally.

But, if the image width and height both larger than the imageView size, the result bitmap size sometimes will change also .

But above all, I think when ImageView scaleType is centerInside, glide load the result bitmap size may be wrong!

I think the best way is let result bitmap size not larger than the imageView size when the image size larger than the imageView size.

Issue 2:
Sometimes we need to load image for center inside, but I have not found this method!

Can add method for center inside?