I am using the Glide image loading library and I'm having issues when it comes to resizing bitmaps.
When using the following code:
Glide.with(getActivity())
.load(images.get(i))
.asBitmap().centerCrop()
.into(new SimpleTarget<Bitmap>(1200, 1200) {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
}
});
Every single bitmap gets resized to the specified dimensions. So, if the image is 400x300, it gets upscaled up to 1200 x 1200 which I do not want. How do I make it so that if the image is smaller than the specified dimensions, it won't resize it?
I'm specifying dimensions because I want every image that's bigger than the specified dimensions to be resized taking into account centerCrop
; and then if the image is smaller than the specified dimensions, I don't want it to be resized.