Package de.hybris.platform.cockpit.util
Class ImageProcessor
- java.lang.Object
-
- de.hybris.platform.cockpit.util.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 voidprocessImageFiles(java.util.List<java.io.File> sourceFiles, java.io.File targetFile, int maxWidth, int maxHeight)java.io.FilescaleImage(java.io.File source, java.io.File target, int maxWidth, int maxHeight, boolean fillSpace)Scales an image to desired dimensions.
-
-
-
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 scaledtarget- location where scaled result shall be written to (directory or regular file)maxWidth- maximum width in pixels; when zero no checking is performedmaxHeight- maximum height in pixels; when zero no checking is performedfillSpace-- 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)
-
-