1
0
mirror of https://github.com/wasabeef/glide-transformations.git synced 2025-10-05 02:13:22 +08:00
This commit is contained in:
wasabeef
2015-07-18 01:47:17 +09:00
parent e9d2c6d209
commit decd2e58d5

View File

@@ -53,12 +53,8 @@ public class CropTransformation implements Transformation<Bitmap> {
@Override
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {
Bitmap source = resource.get();
if (mWidth == 0) {
mWidth = source.getWidth();
}
if (mHeight == 0) {
mHeight = source.getHeight();
}
mWidth = mWidth == 0 ? source.getWidth() : mWidth;
mHeight = mHeight == 0 ? source.getHeight() : mHeight;
Bitmap.Config config =
source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;