|
|
|
@ -442,10 +442,13 @@ class EditProfileActivity : BaseActivity() { |
|
|
|
|
if (sourceBitmap == null) { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
val bitmap = Bitmap.createScaledBitmap(sourceBitmap, resizeWidth, resizeHeight, true) |
|
|
|
|
sourceBitmap.recycle() |
|
|
|
|
if (bitmap == null) { |
|
|
|
|
return false |
|
|
|
|
|
|
|
|
|
//dont upscale image if its smaller than the desired size |
|
|
|
|
val bitmap = |
|
|
|
|
if(sourceBitmap.width <= resizeWidth && sourceBitmap.height <= resizeHeight) { |
|
|
|
|
sourceBitmap |
|
|
|
|
} else { |
|
|
|
|
Bitmap.createScaledBitmap(sourceBitmap, resizeWidth, resizeHeight, true) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
resultBitmap = bitmap |
|
|
|
|