Interface ImagingService
-
- All Known Implementing Classes:
ImagingComponent
public interface ImagingService
- Author:
- Max Stepanov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description PictureView
computeViewFor(Blob blob, PictureConversion pictureConversion, boolean convert)
PictureView
computeViewFor(Blob blob, PictureConversion pictureConversion, ImageInfo imageInfo, boolean convert)
List<List<PictureView>>
computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, boolean convert)
List<List<PictureView>>
computeViewsFor(List<Blob> blobs, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert)
List<PictureView>
computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, boolean convert)
List<PictureView>
computeViewsFor(Blob blob, List<PictureConversion> pictureConversions, ImageInfo imageInfo, boolean convert)
List<PictureView>
computeViewsFor(DocumentModel doc, Blob blob, ImageInfo imageInfo, boolean convert)
Compute all the registeredPictureConversion
For each picture template thecomputeViewFor(Blob, PictureConversion, ImageInfo, boolean)
method is callBlob
convertToPDF(Blob blob)
Converts an image to PDF.Blob
crop(Blob blob, int x, int y, int width, int height)
Crops an image.String
getConfigurationValue(String configurationName)
Returns the value a configuration which name is received as parameter.String
getConfigurationValue(String configurationName, String defaultValue)
Returns the value a configuration which name is received as parameter.ImageInfo
getImageInfo(Blob blob)
Map<String,Object>
getImageMetadata(Blob blob)
Deprecated.since 7.2.String
getImageMimeType(File file)
Returns the mime-type for the given file.String
getImageMimeType(Blob blob)
Returns the mime-type for the given BlobPictureConversion
getPictureConversion(String id)
Returns aPictureConversion
given itsid
.List<PictureConversion>
getPictureConversions()
Returns the registered picture conversions.Blob
resize(Blob blob, String finalFormat, int width, int height, int depth)
Resizes image.Blob
rotate(Blob blob, int angle)
Rotates an image.void
setConfigurationValue(String configurationName, String configurationValue)
Sets the value of a configuration which could be used by the ImagingService.
-
-
-
Method Detail
-
getPictureConversions
List<PictureConversion> getPictureConversions()
Returns the registered picture conversions.- Since:
- 7.1
-
getPictureConversion
PictureConversion getPictureConversion(String id)
Returns aPictureConversion
given itsid
.- Since:
- 7.1
-
rotate
Blob rotate(Blob blob, int angle)
Rotates an image.- Parameters:
blob
- a Blob containing the imageangle
- the angle of the rotation- Returns:
- a Blob holding the rotated image
-
convertToPDF
Blob convertToPDF(Blob blob)
Converts an image to PDF.- Parameters:
blob
- a Blob containing the image- Returns:
- a Blob holding the resulting PDF
- Since:
- 8.4
-
getImageMetadata
@Deprecated Map<String,Object> getImageMetadata(Blob blob)
Deprecated.since 7.2. Please use insteadorg.nuxeo.binary.metadata.api.BinaryMetadataService#readMetadata(Blob, boolean)
Retrieves metadata from an image contained in aBlob
.- Returns:
- the image metadata as a map String -> Object
-
getImageMimeType
String getImageMimeType(Blob blob)
Returns the mime-type for the given Blob- Since:
- 5.7
-
getImageInfo
ImageInfo getImageInfo(Blob blob)
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
String getConfigurationValue(String configurationName)
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
String getConfigurationValue(String configurationName, String defaultValue)
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
void setConfigurationValue(String configurationName, String configurationValue)
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
-
-