Class ResizeImageServiceImpl
- java.lang.Object
-
- org.exoplatform.wiki.service.image.impl.ResizeImageServiceImpl
-
- All Implemented Interfaces:
ResizeImageService
public class ResizeImageServiceImpl extends Object implements ResizeImageService
-
-
Constructor Summary
Constructors Constructor Description ResizeImageServiceImpl(org.exoplatform.services.cache.CacheService caService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamresizeImage(String imageName, InputStream is, int requestWidth, int requestHeight, boolean keepAspectRatio)Resizes a given image to the specified dimensions.InputStreamresizeImageByHeight(String imageName, InputStream is, int requestHeight)Resizes a given image input stream to adapt with the desired height and keep the aspect ratio.InputStreamresizeImageByWidth(String imageName, InputStream is, int requestWidth)Resizes a given image to adapt with the desired width and keep the aspect ratio.
-
-
-
Method Detail
-
resizeImage
public InputStream resizeImage(String imageName, InputStream is, int requestWidth, int requestHeight, boolean keepAspectRatio)
Resizes a given image to the specified dimensions.- Specified by:
resizeImagein interfaceResizeImageService- Parameters:
imageName- Name of the image to be resized.is- The input stream of the image.requestWidth- The new width.requestHeight- The new height.keepAspectRatio- Keeps the aspect ratio or not.- Returns:
- The input stream of the resized image.
- See Also:
ResizeImageService.resizeImage(String, InputStream, int, int, boolean)
-
resizeImageByWidth
public InputStream resizeImageByWidth(String imageName, InputStream is, int requestWidth)
Resizes a given image to adapt with the desired width and keep the aspect ratio.- Specified by:
resizeImageByWidthin interfaceResizeImageService- Parameters:
imageName- Name of the image to be resized.is- The input stream of the image.requestWidth- The desired width.- Returns:
- The input stream of the resized image.
- See Also:
ResizeImageService.resizeImageByWidth(String, InputStream, int)
-
resizeImageByHeight
public InputStream resizeImageByHeight(String imageName, InputStream is, int requestHeight)
Resizes a given image input stream to adapt with the desired height and keep the aspect ratio.- Specified by:
resizeImageByHeightin interfaceResizeImageService- Parameters:
imageName- Name of the resized image.is- The input stream of the image.requestHeight- The desired height.- Returns:
- The input stream of the resized image.
- See Also:
ResizeImageService.resizeImageByHeight(String, InputStream, int)
-
-