@Nullable
    private static InputStream openImageStreamIfLocal(final Uri imageUri) {
        if (UriUtils.isLocalUri(imageUri)) {
            return ContentStorage.get().openForRead(imageUri, true);
        }
        return null;
    }
Image that automatically scales to fit a line of text in the containing {@link TextView}.
main/src/main/java/cgeo/geocaching/utils/ImageUtils.java