Interface ImagingService
- All Known Implementing Classes:
ImagingComponent
public interface ImagingService
- Author:
- Max Stepanov
-
Method Summary
Modifier and TypeMethodDescriptioncomputeViewFor
(Blob blob, PictureConversion pictureConversion, boolean convert) computeViewFor
(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) computeViewsFor
(List<Blob> blobs, List<PictureConversion> pictureConversions, boolean convert) computeViewsFor
(List<Blob> blobs, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) computeViewsFor
(Blob blob, List<PictureConversion> pictureConversions, boolean convert) computeViewsFor
(Blob blob, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) computeViewsFor
(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) Compute all the registeredPictureConversion
For each picture template thecomputeViewFor(Blob, PictureConversion, ImageInfo, boolean)
method is callconvertToPDF
(Blob blob) Converts an image to PDF.Crops an image.getConfigurationValue
(String configurationName) Returns the value a configuration which name is received as parameter.getConfigurationValue
(String configurationName, String defaultValue) Returns the value a configuration which name is received as parameter.getImageInfo
(Blob blob) getImageMimeType
(File file) Returns the mime-type for the given file.getImageMimeType
(Blob blob) Returns the mime-type for the given BlobReturns aPictureConversion
given itsid
.Returns the registered picture conversions.Resizes image.Rotates an image.void
setConfigurationValue
(String configurationName, String configurationValue) Sets the value of a configuration which could be used by the ImagingService.
-
Method Details
-
getPictureConversions
List<PictureConversion> getPictureConversions()Returns the registered picture conversions.- Since:
- 7.1
-
getPictureConversion
Returns aPictureConversion
given itsid
.- Since:
- 7.1
-
crop
Crops an image. -
resize
Resizes image. -
rotate
Rotates an image.- Parameters:
blob
- a Blob containing the imageangle
- the angle of the rotation- Returns:
- a Blob holding the rotated image
-
convertToPDF
Converts an image to PDF.- Parameters:
blob
- a Blob containing the image- Returns:
- a Blob holding the resulting PDF
- Since:
- 8.4
-
getImageMimeType
Returns the mime-type for the given file. -
getImageMimeType
Returns the mime-type for the given Blob- Since:
- 5.7
-
getImageInfo
Retrieves theImageInfo
of theBlob
that is received as parameter.The information provided by the ImageInfo, like width, height or format, is obtained using ImageMagick (see http://www.imagemagick.org/script/index.php for more details on ImageMagick).
- Parameters:
blob
- the blob of a picture- Returns:
- the
ImageInfo
of a blob
-
getConfigurationValue
Returns the value a configuration which name is received as parameter.- Parameters:
configurationName
- the name of the configuration- Returns:
- the value of the configuration, which can be null in case no configuration with the specified name was registered
-
getConfigurationValue
Returns the value a configuration which name is received as parameter. In case no configuration with the specified name was registered, the received defaultValue parameter will be returned.- Parameters:
configurationName
- the name of the configurationdefaultValue
- the value of the configuration
-
setConfigurationValue
Sets the value of a configuration which could be used by the ImagingService.- Parameters:
configurationName
- the name of the configurationconfigurationValue
- the value of the configuration
-
computeViewFor
PictureView computeViewFor(Blob blob, PictureConversion pictureConversion, boolean convert) throws IOException - Parameters:
convert
- true if theblob
is converted to fit thepictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Returns:
- the computed picture view
- Throws:
IOException
- Since:
- 5.7
-
computeViewFor
PictureView computeViewFor(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert) throws IOException - Parameters:
imageInfo
- theImageInfo
to use when computing the viewconvert
- true if theblob
is converted to fit thepictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Returns:
- the computed picture view
- Throws:
IOException
- Since:
- 5.7
-
computeViewsFor
List<PictureView> computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, boolean convert) throws IOException - Parameters:
convert
- true if theblob
is converted to fit eachPictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Returns:
- the computed picture views as a List of
PictureView
s - Throws:
IOException
- Since:
- 5.7
-
computeViewsFor
List<PictureView> computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) throws IOException - Parameters:
imageInfo
- theImageInfo
to use when computing the viewconvert
- true if theblob
is converted to fit eachPictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Returns:
- the computed picture views as a List of
PictureView
s - Throws:
IOException
- Since:
- 5.7
-
computeViewsFor
List<List<PictureView>> computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, boolean convert) throws IOException - Parameters:
convert
- true if theblob
is converted to fit eachPictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Throws:
IOException
- Since:
- 5.7
-
computeViewsFor
List<List<PictureView>> computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert) throws IOException - Parameters:
imageInfo
- theImageInfo
to use when computing the viewconvert
- true if theblob
is converted to fit eachPictureConversion
, false if theblob
is put as it in the PictureView (without any conversion)- Throws:
IOException
- Since:
- 5.7
-
computeViewsFor
List<PictureView> computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert) throws IOException Compute all the registeredPictureConversion
For each picture template thecomputeViewFor(Blob, PictureConversion, ImageInfo, boolean)
method is call- Throws:
IOException
- Since:
- 7.1
-