Optimize resizeBitmap(): Skip resizing for already-small images (#2565)

Co-authored-by: Sylvia van Os <sylvia@hackerchick.me>
This commit is contained in:
Yash R. Dhake
2025-06-30 00:54:12 +05:30
committed by GitHub
parent 59fb95a4a7
commit bcb7df24ec

View File

@@ -594,6 +594,11 @@ public class Utils {
double width = bitmap.getWidth();
double height = bitmap.getHeight();
// Early exit
if (Math.max(width, height) <= maxSize) {
return bitmap;
}
if (height > width) {
double scale = height / maxSize;
height = maxSize;