Interface PictureResolution
- All Superinterfaces:
Comparable<StoreElement>
,StoreElement
,Workflowable
This interface provides methods to get the specification of a PictureResolution for a medium from the MediaStore.
- Since:
- 3.0
-
Method Summary
Modifier and TypeMethodDescriptionlong
getCrc()
Get theCRC32
of the picture data or -1 if the picture is generated (scaled from the original resolution) on demand.@Nullable PictureCropData
Get the Crop information of current picture resolution if exists (bounds related to original resolution) ornull
if parameter cropData isn't set.Get the extension of the current picture resolution.int
Get the height of the current picture resolution or -1 if the picture is generated (scaled from the original resolution) on demand.@Nullable MimeType
Get the mime-type of the current picture resolution.@NotNull String
getName()
Returns the name of the underlying resolution (e.g.Get revision for picture data.Get the resolution as an object of the current picture resolution.long
getSize()
Get the size of the picture or -1 if the picture is generated (scaled from the original resolution) on demand.int
getWidth()
Get the width of the current picture resolution or -1 if the picture is generated (scaled from the original resolution) on demand.boolean
Returnstrue
if the saved picture is deprecated (the cropped picture data was created based on an original resolution image that doesn't exist any longer), andfalse
otherwise.void
setCropData
(@Nullable PictureCropData cropData) Sets the crop information related to the original resolution, ornull
to remove.void
setExtension
(String extension) Set the file extension.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.access.store.StoreElement
appendChild, appendChildBefore, delete, exportStoreElement, getChildCount, getChildIndex, getChildren, getChildren, getChildren, getChildren, getCreateWorkflowPermission, getDefinedPrincipalPermissions, getEditor, getElementType, getFirstChild, getIncomingReferences, getInheritedPrincipalPermissions, getLastChanged, getNextSibling, getOutgoingReferences, getParent, getPermission, getPermission, getPermission, getPreviousSibling, getProject, getReferenceName, getReferences, getReferences, getStore, getTreePermission, getWorkflowPermission, getWorkflowPermissions, getWriteLock, hasIncomingReferences, hasPermissions, importStoreElement, importStoreElements, inheritWorkflowPermission, isDeleted, isExportSupported, isFolder, isImportSupported, isLocked, isLockedOnServer, isLockSupported, isPermissionSupported, isWorkflowAllowed, isWorkflowSupported, refresh, removeAllWorkflowPermissions, removeChild, removePermission, removePermission, removePermission, removeWorkflowPermission, replaceChild, save, save, save, setInheritWorkflowPermission, setLock, setLock, setPermission, setPermission, setPermission, setWorkflowPermission, setWorkflowPermissions, setWriteLock, toXml, toXml, toXml
Methods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
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.
UsePicture.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.
UsePicture.getPictureMetaData(Resolution)
to get the width of on demand generated resolutions.- Returns:
- width of the picture resolution.
- Since:
- 3.0
- See Also:
-
getCropData
Get the Crop information of current picture resolution if exists (bounds related to original resolution) ornull
if parameter cropData isn't set.- Returns:
- Crop information of current picture resolution.
- Since:
- 4.1.10
-
setCropData
Sets the crop information related to the original resolution, ornull
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()Returnstrue
if the saved picture is deprecated (the cropped picture data was created based on an original resolution image that doesn't exist any longer), andfalse
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
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
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.
UsePicture.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
Returns the name of the underlying resolution (e.g. ORIGINAL if the resolution is the ORIGINAL resolution).- Specified by:
getName
in interfaceStoreElement
- 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 theCRC32
of the picture data or -1 if the picture is generated (scaled from the original resolution) on demand.
UsePicture.getPictureMetaData(Resolution)
to get theCRC32
of on demand generated resolutions.- Returns:
- the
CRC32
checksum of the picture data. - Since:
- 4.0
- See Also:
-