Class 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 Detail

      • Builder

        public Builder()
    • 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 by constraints.
        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.