public class

ImageDocumentUtils

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.ImageDocumentUtils

Class Overview

Collection of helper methods for working with ImageDocuments.

Summary

Public Constructors
ImageDocumentUtils()
Public Methods
static boolean isImageUri(Context context, Uri uri)
Checks whether the content returned by resolving uri has an image MIME type.
static void refreshMediaStore(Context context, ImageDocument imageDocument)
Sends a media scanner broadcast intent that will trigger a re-scanning of the ImageDocument's original image file.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ImageDocumentUtils ()

Public Methods

public static boolean isImageUri (Context context, Uri uri)

Checks whether the content returned by resolving uri has an image MIME type.

Parameters
context The context used to resolve mime type via ContentResolver.
uri A content provider URI with supported scheme (i.e. content://).
Returns
  • true when uri points to image content (has mime type image/*).

public static void refreshMediaStore (Context context, ImageDocument imageDocument)

Sends a media scanner broadcast intent that will trigger a re-scanning of the ImageDocument's original image file. Using this method after saving an ImageDocument ensures that all Android media apps will show the latest version of that image.

This method is a no-op if imageDocument is not backed by file Uri - i.e. when imageDocument.getImageDocumentSource().getFileUri() returns null.

Parameters
context The context used to fire media scanner broadcast.
imageDocument Document to scan.