Package de.xima.fc.common.image
Class CropScaleImageThumbnailGenerator.Builder
- java.lang.Object
-
- de.xima.fc.common.image.CropScaleImageThumbnailGenerator.Builder
-
- Enclosing class:
- CropScaleImageThumbnailGenerator
public static final class CropScaleImageThumbnailGenerator.Builder extends Object
A builder for a thumbnail generator that scales down images to a defined width and height. Images that do not fit the aspect ratio are cropped appropriately.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IImageThumbnailGenerator
build()
Builds the thumbnail generator with the current configuration.CropScaleImageThumbnailGenerator.Builder
defaultDimensions(int width, int height)
Sets the desired default target width and height for the thumbnail.CropScaleImageThumbnailGenerator.Builder
format(de.xima.cmn.utils.XImageUtils.EImageFormat format)
Sets the desired format for the thumbnail.
-
-
-
Method Detail
-
build
public IImageThumbnailGenerator build()
Builds the thumbnail generator with the current configuration. Subsequent changes to the builder do not affect the generator.- Returns:
- The thumbnail generator.
-
defaultDimensions
public CropScaleImageThumbnailGenerator.Builder defaultDimensions(int width, int height)
Sets the desired default target width and height for the thumbnail. The image is scaled down to fit the dimensions. May be overwritten byconstraints
.- Parameters:
width
- The target width.height
- The target height.- Returns:
- This builder for chaining method calls.
-
format
public CropScaleImageThumbnailGenerator.Builder format(de.xima.cmn.utils.XImageUtils.EImageFormat format)
Sets the desired format for the thumbnail. Defaults to png.- Parameters:
format
- The desired format.- Returns:
- This builder for chaining method calls.
-
-