Fix pre-upload image resizing

This commit is contained in:
Grishka 2022-04-23 22:25:58 +03:00
parent 559835d849
commit f499444a86
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ public class ResizedImageRequestBody extends CountingRequestBody{
} }
if(factor%1f!=0f){ if(factor%1f!=0f){
Bitmap scaled=Bitmap.createBitmap(targetWidth, targetHeight, Bitmap.Config.ARGB_8888); Bitmap scaled=Bitmap.createBitmap(targetWidth, targetHeight, Bitmap.Config.ARGB_8888);
new Canvas(scaled).drawBitmap(bitmap, null, new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()), new Paint(Paint.FILTER_BITMAP_FLAG)); new Canvas(scaled).drawBitmap(bitmap, null, new Rect(0, 0, targetWidth, targetHeight), new Paint(Paint.FILTER_BITMAP_FLAG));
bitmap=scaled; bitmap=scaled;
} }
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){ if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N){