Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.picture.api
Interface ImagingService

All Known Subinterfaces:
ImagingServiceLocal
All Known Implementing Classes:
ImagingComponent, ImagingServiceBean

public interface ImagingService

Author:
Max Stepanov

Method Summary
 Blob crop(Blob blob, int x, int y, int width, int height)
          Crops an image.
 java.io.InputStream crop(java.io.InputStream in, int x, int y, int width, int height)
          Deprecated. use {@link #crop(Blob, int, int, int, int)
 java.lang.String getConfigurationValue(java.lang.String configurationName)
          Returns the value a configuration which name is received as parameter.
 java.lang.String getConfigurationValue(java.lang.String configurationName, java.lang.String defaultValue)
          Returns the value a configuration which name is received as parameter.
 ImageInfo getImageInfo(Blob blob)
          Retrieves the ImageInfo of the Blob that is received as parameter.
 java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(Blob blob)
          Retrieves metadata from an image contained in a Blob.
 java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(java.io.File file)
          Deprecated. 
 java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(java.io.InputStream in)
          Deprecated. 
 java.lang.String getImageMimeType(java.io.File file)
          Returns the mime-type for the given file.
 java.lang.String getImageMimeType(java.io.InputStream in)
          Returns the mime-type for the given input stream.
 Blob resize(Blob blob, java.lang.String finalFormat, int width, int height, int depth)
          Resizes image.
 java.io.InputStream resize(java.io.InputStream in, int width, int height)
          Deprecated. use {@link #resize(Blob, String, int, int, int)
 Blob rotate(Blob blob, int angle)
          Rotates an image.
 java.io.InputStream rotate(java.io.InputStream in, int angle)
          Deprecated. use {@link #rotate(Blob, int)
 void setConfigurationValue(java.lang.String configurationName, java.lang.String configurationValue)
          Sets the value of a configuration which could be used by the ImagingService.
 

Method Detail

crop

@Deprecated
java.io.InputStream crop(java.io.InputStream in,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
Deprecated. use {@link #crop(Blob, int, int, int, int)

Crop image.

Returns:
resized image file created in temporary folder

resize

@Deprecated
java.io.InputStream resize(java.io.InputStream in,
                                      int width,
                                      int height)
Deprecated. use {@link #resize(Blob, String, int, int, int)

Resize image.

Returns:
resized image file created in temporary folder

rotate

@Deprecated
java.io.InputStream rotate(java.io.InputStream in,
                                      int angle)
Deprecated. use {@link #rotate(Blob, int)

Rotate image.


crop

Blob crop(Blob blob,
          int x,
          int y,
          int width,
          int height)
Crops an image.


resize

Blob resize(Blob blob,
            java.lang.String finalFormat,
            int width,
            int height,
            int depth)
Resizes image.


rotate

Blob rotate(Blob blob,
            int angle)
Rotates an image.

Parameters:
blob - a Blob containing the image
angle - the angle of the rotation
Returns:
a Blob holding the rotated image

getImageMetadata

@Deprecated
java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(java.io.InputStream in)
Deprecated. 

Retrieves metadata from an image.


getImageMetadata

@Deprecated
java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(java.io.File file)
Deprecated. 

Retrieves metadata from an image.


getImageMetadata

java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(Blob blob)
Retrieves metadata from an image contained in a Blob.

Returns:
the image metadata as a map String -> Object

getImageMimeType

java.lang.String getImageMimeType(java.io.File file)
Returns the mime-type for the given file.


getImageMimeType

java.lang.String getImageMimeType(java.io.InputStream in)
Returns the mime-type for the given input stream.


getImageInfo

ImageInfo getImageInfo(Blob blob)
Retrieves the ImageInfo of the Blob 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

java.lang.String getConfigurationValue(java.lang.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

java.lang.String getConfigurationValue(java.lang.String configurationName,
                                       java.lang.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 configuration
defaultValue - the value of the configuration

setConfigurationValue

void setConfigurationValue(java.lang.String configurationName,
                           java.lang.String configurationValue)
Sets the value of a configuration which could be used by the ImagingService.

Parameters:
configurationName - the name of the configuration
configurationValue - the value of the configuration

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.