Interface PictureResolution

All Superinterfaces:
Comparable<StoreElement>, StoreElement, Workflowable

public interface PictureResolution extends StoreElement
This interface provides methods to get the specification of a PictureResolution for a medium from the MediaStore.
Since:
3.0
  • Method Details

    • getHeight

      int getHeight()
      Get the height of the current picture resolution or -1 if the picture is generated (scaled from the original resolution) on demand.
      Use Picture.getPictureMetaData(Resolution) to get the height of on demand generated resolutions.
      Returns:
      height of the picture resolution.
      Since:
      3.0
      See Also:
    • getWidth

      int getWidth()
      Get the width of the current picture resolution or -1 if the picture is generated (scaled from the original resolution) on demand.
      Use Picture.getPictureMetaData(Resolution) to get the width of on demand generated resolutions.
      Returns:
      width of the picture resolution.
      Since:
      3.0
      See Also:
    • getCropData

      @Nullable @Nullable PictureCropData getCropData()
      Get the Crop information of current picture resolution if exists (bounds related to original resolution) or null if parameter cropData isn't set.
      Returns:
      Crop information of current picture resolution.
      Since:
      4.1.10
    • setCropData

      void setCropData(@Nullable @Nullable PictureCropData cropData)
      Sets the crop information related to the original resolution, or null to remove. The specified data should describe the current crop state. If the specified data has no selection rectangle, the crop information will also get removed.
      Note: Calling this method will not lead to an actual crop of the current picture!
      Parameters:
      cropData - the crop information related to original resolution.
      Since:
      4.1.10
    • isDeprecated

      boolean isDeprecated()
      Returns true if the saved picture is deprecated (the cropped picture data was created based on an original resolution image that doesn't exist any longer), and false otherwise.
      Returns:
      true if picture is deprecated, false otherwise.
      Since:
      4.1.10
    • getExtension

      String getExtension()
      Get the extension of the current picture resolution. The extension is determined by a mime-type detection and a reverse mime-type to extension mapping. So if you rename a pdf to png it should not be possible to upload a file to this medium because it's not a picture.
      Returns:
      extension of the picture resolution.
      Since:
      3.0
    • getMimeType

      @Nullable @Nullable MimeType getMimeType()
      Get the mime-type of the current picture resolution. The Mime-Type detection is done in unix style magic-mime lookup and some fallback mechanisms.
      Returns:
      mime-type of the picture resolution or null if the medium is a pre 5.0 medium.
      Since:
      5.0
    • setExtension

      void setExtension(String extension)
      Set the file extension. The extension is also set by the upload methods. The extension is determined by a mime-type detection and a reverse mime-type to extension mapping. e.g. if you rename a pdf to png it should not be possible to upload a file to this medium because it's not a picture.
      Parameters:
      extension - the file extension.
      Since:
      3.0
    • getSize

      long getSize()
      Get the size of the picture or -1 if the picture is generated (scaled from the original resolution) on demand.
      Use Picture.getPictureMetaData(Resolution) to get the size of on demand generated resolutions.
      Returns:
      The size in bytes.
      Since:
      3.0
      See Also:
    • getResolution

      Resolution getResolution()
      Get the resolution as an object of the current picture resolution.
      Returns:
      resolution of the picture resolution.
      Since:
      3.0
    • getName

      @NotNull @NotNull String getName()
      Returns the name of the underlying resolution (e.g. ORIGINAL if the resolution is the ORIGINAL resolution).
      Specified by:
      getName in interface StoreElement
      Returns:
      String name of the resolution.
      Since:
      4.0
    • getPictureRevision

      Revision getPictureRevision()
      Get revision for picture data. null means the picture is generated (scaled from the original resolution) on demand.
      Since:
      4.0
    • getCrc

      long getCrc()
      Get the CRC32 of the picture data or -1 if the picture is generated (scaled from the original resolution) on demand.
      Use Picture.getPictureMetaData(Resolution) to get the CRC32 of on demand generated resolutions.
      Returns:
      the CRC32 checksum of the picture data.
      Since:
      4.0
      See Also: