Class OperationSizeOptimization


  • public class OperationSizeOptimization
    extends Object
    If you use a JPEG \"image type element,\" the file size can be automatically optimized. The corresponding optimization routine will attempt to limit the file to a max. size by gradually reducing the JPEG quality until the image is smaller than a specific size. If the \"sizeOptimization\" block is present, the image will be optimized. If it is not present, the image will not be optimized further after being exported. **Important:** Please note that optimization can make the graphic export operation significantly slower. In addition to this, make sure to use values for the \"dpi\", \"height\", and \"width\" parameters that ensure that the size you want can actually be reached with compression.
    • Constructor Detail

      • OperationSizeOptimization

        public OperationSizeOptimization()
    • Method Detail

      • getMaxRetries

        @Nullable
        public @Nullable Integer getMaxRetries()
        Used to specify the number of runs that should be used for optimization. If the target size cannot be reached after the specified number of runs, the operation will be cancelled and an error code will be returned.
        Returns:
        maxRetries
      • setMaxRetries

        public void setMaxRetries​(Integer maxRetries)
      • getMaxSize

        @Nullable
        public @Nullable Integer getMaxSize()
        Used to define the maximum size of the JPEG file (file size), in bytes, that should be reached. The optimization routine will be successfully completed if the file reaches or falls below the specified file size. Make sure to use a value > 0; otherwise, an error will be thrown.
        Returns:
        maxSize
      • setMaxSize

        public void setMaxSize​(Integer maxSize)
      • getStepSize

        @Nullable
        public @Nullable Integer getStepSize()
        Used to define the increment by which the JPEG quality (jpegQuality) should be reduced every run in order to reach the desired file size. If the values for maxRetries and stepSize result in an illegal JPEG quality value being reached, the operation will be cancelled and an error code will be returned.
        Returns:
        stepSize
      • setStepSize

        public void setStepSize​(Integer stepSize)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object