Package de.hybris.platform.cockpit.util
Class ImageProcessor
java.lang.Object
de.hybris.platform.cockpit.util.ImageProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocessImageFiles(List<File> sourceFiles, File targetFile, int maxWidth, int maxHeight) scaleImage(File source, File target, int maxWidth, int maxHeight, boolean fillSpace) Scales an image to desired dimensions.
-
Constructor Details
-
ImageProcessor
public ImageProcessor()
-
-
Method Details
-
scaleImage
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
-