@NonNull
    public static BitmapDrawable scaleBitmapToDisplay(@NonNull final Bitmap image) {

        //special case: 1x1 images used for layouting
        final boolean isOneToOne = image.getHeight() == 1 && image.getWidth() == 1;

        final Point displaySize = DisplayUtils.getDisplaySize();
        final int maxWidth = displaySize.x - 25;
        final int maxHeight = displaySize.y - 25;
        final int minWidth = isOneToOne ? 1 : ViewUtils.spToPixel(20);
        final int minHeight = isOneToOne ? 1 : ViewUtils.spToPixel(20);
        return scaleBitmapTo(image, maxWidth, maxHeight, minWidth, minHeight);
    }
Scales a bitmap to the device display size. Also ensures a minimum image size

@param image The image Bitmap representation to scale
@return BitmapDrawable The scaled image
main/src/main/java/cgeo/geocaching/utils/ImageUtils.java