org.exoplatform.forum.common.image
Interface ResizeImageService

All Known Implementing Classes:
ResizeImageServiceImpl

public interface ResizeImageService

APIs for resize images operations. Images can be resized by specific input width and height.


Method Summary
 InputStream resizeImage(String imageName, InputStream is, int requestWidth, int requestHeight, boolean keepAspectRatio)
          Resizes the given image input stream to the specified dimensions.
 InputStream resizeImageByHeight(String imageName, InputStream is, int requestHeight)
          Resizes the given image input stream to the adapt requested height and keep the aspect ratio.
 InputStream resizeImageByWidth(String imageName, InputStream is, int requestWidth)
          Resizes the given image input stream to the adapt requested width and keep the aspect ratio.
 

Method Detail

resizeImage

InputStream resizeImage(String imageName,
                        InputStream is,
                        int requestWidth,
                        int requestHeight,
                        boolean keepAspectRatio)
                        throws FileNotSupportedException
Resizes the given image input stream to the specified dimensions.

Parameters:
imageName - is the name of image to be resized
is - is the input stream of image
requestWidth - the new image width
requestHeight - the new image height
keepAspectRatio - keep the aspect ratio or not
Returns:
the resized input stream
Throws:
FileNotSupportedException

resizeImageByWidth

InputStream resizeImageByWidth(String imageName,
                               InputStream is,
                               int requestWidth)
                               throws FileNotSupportedException
Resizes the given image input stream to the adapt requested width and keep the aspect ratio.

Parameters:
imageName - is the name of image to be resized
is - is the input stream of image
requestWidth - the new image width
Throws:
FileNotSupportedException

resizeImageByHeight

InputStream resizeImageByHeight(String imageName,
                                InputStream is,
                                int requestHeight)
                                throws FileNotSupportedException
Resizes the given image input stream to the adapt requested height and keep the aspect ratio.

Parameters:
imageName - is the name of image to be resized
is - is the input stream of image
requestHeight - the new image height
Returns:
the resized input stream
Throws:
FileNotSupportedException


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.