Class ImageProcessor

java.lang.Object
de.hybris.platform.cockpit.util.ImageProcessor

public class ImageProcessor extends Object
  • Constructor Details

    • ImageProcessor

      public ImageProcessor()
  • Method Details

    • scaleImage

      public File scaleImage(File source, File target, int maxWidth, int maxHeight, boolean fillSpace)
      Scales an image to desired dimensions. Dimension is given by a maximum width and height. When width is given and height is zero, height gets ignored and scale factor gets calculated by checking against maximum width only. Same for given height and zero width. When width and height are zero no scaling is performed and source image gets returned as result.
      Parameters:
      source - file which shall be scaled
      target - location where scaled result shall be written to (directory or regular file)
      maxWidth - maximum width in pixels; when zero no checking is performed
      maxHeight - maximum height in pixels; when zero no checking is performed
      fillSpace -
      Returns:
      the scaled image as File
    • processImageFiles

      public void processImageFiles(List<File> sourceFiles, File targetFile, int maxWidth, int maxHeight)