org.exoplatform.wiki.service.image.impl
Class ResizeImageServiceImpl

java.lang.Object
  extended by org.exoplatform.wiki.service.image.impl.ResizeImageServiceImpl
All Implemented Interfaces:
ResizeImageService

public class ResizeImageServiceImpl
extends Object
implements ResizeImageService


Constructor Summary
ResizeImageServiceImpl(org.exoplatform.services.cache.CacheService caService)
           
 
Method Summary
 InputStream resizeImage(String imageName, InputStream is, int requestWidth, int requestHeight, boolean keepAspectRatio)
          Resize the given image input stream to the specified dimensions.
 InputStream resizeImageByHeight(String imageName, InputStream is, int requestHeight)
          Resize the given image input stream to the adapt requested height and keep the aspect ratio.
 InputStream resizeImageByWidth(String imageName, InputStream is, int requestWidth)
          Resize the given image input stream to the adapt requested width and keep the aspect ratio.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResizeImageServiceImpl

public ResizeImageServiceImpl(org.exoplatform.services.cache.CacheService caService)
Method Detail

resizeImage

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

Specified by:
resizeImage in interface ResizeImageService
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
See Also:
ResizeImageService.resizeImage(String, InputStream, int, int, boolean)

resizeImageByWidth

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

Specified by:
resizeImageByWidth in interface ResizeImageService
Parameters:
imageName - is the name of image to be resized
is - is the input stream of image
requestWidth - the new image width
See Also:
ResizeImageService.resizeImageByWidth(String, InputStream, int)

resizeImageByHeight

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

Specified by:
resizeImageByHeight in interface ResizeImageService
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
See Also:
ResizeImageService.resizeImageByHeight(String, InputStream, int)


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