Class ImageProcessor


  • public class ImageProcessor
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageProcessor()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void processImageFiles​(java.util.List<java.io.File> sourceFiles, java.io.File targetFile, int maxWidth, int maxHeight)  
      java.io.File scaleImage​(java.io.File source, java.io.File target, int maxWidth, int maxHeight, boolean fillSpace)
      Scales an image to desired dimensions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageProcessor

        public ImageProcessor()
    • Method Detail

      • scaleImage

        public java.io.File scaleImage​(java.io.File source,
                                       java.io.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​(java.util.List<java.io.File> sourceFiles,
                                      java.io.File targetFile,
                                      int maxWidth,
                                      int maxHeight)