All Superinterfaces:
Comparable<StoreElement>, MediaElement, StoreElement, Workflowable

public interface Picture extends MediaElement
This interface provides methods to handle a media object of type PICTURE from the MediaStore.

A Picture can be retrieved from a type Media object by calling the Media.getPicture(Language) getPicture()}-method. A language must be provided within the method call.

Since:
3.0
See Also:
  • Method Details

    • getLanguage

      Language getLanguage()
      Get the language of the current picture-media
      Returns:
      language of the current picture-media as object.
      Since:
      3.0
    • getPictureMetaData

      @Nullable @Nullable MediaMetaData getPictureMetaData(Resolution resolution) throws IOException
      Return media metadata for explicitly set and automatically generated picture resolutions. Only returns null if a picture is not explicitly set for the resolution and an automatically generated picture resolution could not be generated because an original resolution is not available. In all other cases the result value is not null.
      Parameters:
      resolution - the resolution to get the media metadata for.
      Returns:
      the media metadata for the resolution.
      Throws:
      IOException
      Since:
      4.0
    • getInputStream

      @Nullable @Nullable InputStream getInputStream(Resolution resolution) throws IOException
      Get the picture content of the current picture-media as an input stream. The returned image is either an on demand scaled version of the original image or a saved resolution.
      Parameters:
      resolution - the resolution to get the picture data for.
      Returns:
      the picture data as stream.
      Throws:
      IOException - thrown if any error occurs loading the picture.
      Since:
      4.0
    • setPicture

      void setPicture(Resolution resolution, long length, InputStream pictureStream, @Nullable @Nullable String extension) throws IOException
      Uploads the picture data for the given resolution by reading from the given input stream.
      Parameters:
      resolution - the resolution to set the picture data for
      length - the length of the given input stream
      pictureStream - the data stream
      extension - the extension for the picture (if null the extension is determined from the calculated mime type)
      Throws:
      IOException - thrown if any error occurs setting the picture.
      Since:
      4.0
    • removePicture

      void removePicture(Resolution resolution) throws IOException
      Remove the picture of the current picture-media for given resolution.
      Parameters:
      resolution - resolution for which the picture has to be removed.
      Throws:
      IOException
      Since:
      3.0
    • getPictureResolution

      @NotNull @NotNull PictureResolution getPictureResolution(Resolution resolution)
      Get the picture-resolution child StoreElement of this picture-media for the given resolution.
      Parameters:
      resolution - resolution for which the picture-resolution must be returned.
      Returns:
      picture-resolution of the current picture-media.
      Since:
      3.0
    • getDescription

      String getDescription()
      Get the description of the current media.
      Returns:
      description of the media.
      Since:
      3.0
    • setDescription

      void setDescription(String description)
      Set the description of the current media.
      Parameters:
      description - new description of the media.
      Since:
      3.0
    • getPreview

      @Deprecated @Nullable @org.jetbrains.annotations.Nullable byte[] getPreview() throws IOException
      Deprecated.
      since 5.0 - use getPreviewImage()
      Get a small preview/thumbnail image of this picture.
      Returns:
      preview picture-media or null.
      Throws:
      IOException - if any error occurs while obtaining the preview .
      Since:
      3.0
    • getPreviewImage

      @Nullable @org.jetbrains.annotations.Nullable byte[] getPreviewImage() throws IOException
      Get a small preview/thumbnail image of this picture.
      Returns:
      preview the picture-media preview image or null.
      Throws:
      IOException - thrown if any error occurs while obtaining the preview image stream.
      Since:
      5.0.100
    • setPreviewImage

      void setPreviewImage(@Nullable @org.jetbrains.annotations.Nullable byte[] bytes)
      Set the image data source to create a preview-thumbnail from. This could be a non-scaled instance, down-scaling to fit into 100x100 pixels is then done automatically.
      Parameters:
      bytes - the image data or null to reset the preview image.
      Since:
      5.0.100