Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.picture.ejb
Class ImagingServiceBean

java.lang.Object
  extended by org.nuxeo.ecm.platform.picture.ejb.ImagingServiceBean
All Implemented Interfaces:
ImagingService, ImagingServiceLocal

public class ImagingServiceBean
extends java.lang.Object
implements ImagingServiceLocal

Session bean wrapper for the local ImagingService

Enable EJB remoting for the local nuxeo-runtime service

Author:
Bogdan Stefanescu

Constructor Summary
ImagingServiceBean()
           
 
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)
          Crop image.
 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)
          Resize image.
 Blob rotate(Blob blob, int angle)
          Rotates an image.
 java.io.InputStream rotate(java.io.InputStream in, int angle)
          Rotate image.
 void setConfigurationValue(java.lang.String configurationName, java.lang.String configurationValue)
          Sets the value of a configuration which could be used by the ImagingService.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagingServiceBean

public ImagingServiceBean()
Method Detail

getImageMetadata

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

Description copied from interface: ImagingService
Retrieves metadata from an image.

Specified by:
getImageMetadata in interface ImagingService

getImageMetadata

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

Description copied from interface: ImagingService
Retrieves metadata from an image.

Specified by:
getImageMetadata in interface ImagingService

getImageMetadata

public java.util.Map<java.lang.String,java.lang.Object> getImageMetadata(Blob blob)
Description copied from interface: ImagingService
Retrieves metadata from an image contained in a Blob.

Specified by:
getImageMetadata in interface ImagingService
Returns:
the image metadata as a map String -> Object

resize

public java.io.InputStream resize(java.io.InputStream in,
                                  int width,
                                  int height)
Description copied from interface: ImagingService
Resize image.

Specified by:
resize in interface ImagingService
Returns:
resized image file created in temporary folder

rotate

public java.io.InputStream rotate(java.io.InputStream in,
                                  int angle)
Description copied from interface: ImagingService
Rotate image.

Specified by:
rotate in interface ImagingService

crop

public java.io.InputStream crop(java.io.InputStream in,
                                int x,
                                int y,
                                int width,
                                int height)
Description copied from interface: ImagingService
Crop image.

Specified by:
crop in interface ImagingService
Returns:
resized image file created in temporary folder

crop

public Blob crop(Blob blob,
                 int x,
                 int y,
                 int width,
                 int height)
Description copied from interface: ImagingService
Crops an image.

Specified by:
crop in interface ImagingService

resize

public Blob resize(Blob blob,
                   java.lang.String finalFormat,
                   int width,
                   int height,
                   int depth)
Description copied from interface: ImagingService
Resizes image.

Specified by:
resize in interface ImagingService

rotate

public Blob rotate(Blob blob,
                   int angle)
Description copied from interface: ImagingService
Rotates an image.

Specified by:
rotate in interface ImagingService
Parameters:
blob - a Blob containing the image
angle - the angle of the rotation
Returns:
a Blob holding the rotated image

getImageMimeType

public java.lang.String getImageMimeType(java.io.File file)
Description copied from interface: ImagingService
Returns the mime-type for the given file.

Specified by:
getImageMimeType in interface ImagingService

getImageMimeType

public java.lang.String getImageMimeType(java.io.InputStream in)
Description copied from interface: ImagingService
Returns the mime-type for the given input stream.

Specified by:
getImageMimeType in interface ImagingService

getImageInfo

public ImageInfo getImageInfo(Blob blob)
Description copied from interface: ImagingService
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).

Specified by:
getImageInfo in interface ImagingService
Parameters:
blob - the blob of a picture
Returns:
the ImageInfo of a blob

getConfigurationValue

public java.lang.String getConfigurationValue(java.lang.String configurationName)
Description copied from interface: ImagingService
Returns the value a configuration which name is received as parameter.

Specified by:
getConfigurationValue in interface ImagingService
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

public java.lang.String getConfigurationValue(java.lang.String configurationName,
                                              java.lang.String defaultValue)
Description copied from interface: ImagingService
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.

Specified by:
getConfigurationValue in interface ImagingService
Parameters:
configurationName - the name of the configuration
defaultValue - the value of the configuration

setConfigurationValue

public void setConfigurationValue(java.lang.String configurationName,
                                  java.lang.String configurationValue)
Description copied from interface: ImagingService
Sets the value of a configuration which could be used by the ImagingService.

Specified by:
setConfigurationValue in interface 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.