Nuxeo ECM Projects 5.4.3-SNAPSHOT

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

All Known Implementing Classes:
ImagingComponent

public interface ImagingService

Author:
Max Stepanov

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

Method Detail

crop

@Deprecated
InputStream crop(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
InputStream resize(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
InputStream rotate(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,
            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
Map<String,Object> getImageMetadata(InputStream in)
Deprecated. 

Retrieves metadata from an image.


getImageMetadata

@Deprecated
Map<String,Object> getImageMetadata(File file)
Deprecated. 

Retrieves metadata from an image.


getImageMetadata

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

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

getImageMimeType

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


getImageMimeType

String getImageMimeType(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

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 configuration
defaultValue - 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 configuration
configurationValue - the value of the configuration

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.