public class ScalrProcessorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ImageDimension |
identifyDimension(File sourceFile)
Detects the
sourceFile and returns the size dimension from it. |
static void |
resizeImage(File sourceFile,
File targetFile,
ImageDimension dimension)
Resize the given image
sourceFile with resizing it to width and height
and store the resized image to targetFile . |
static void |
resizeImage(File sourceFile,
File targetFile,
ImageDimension dimension,
String... extraOptions)
Resize the given image
sourceFile with resizing it to width and height
and store the resized image to targetFile , with appending extraOptions in the command line if provided. |
public static ImageDimension identifyDimension(File sourceFile) throws IOException
sourceFile
and returns the size dimension from it.sourceFile
- source image filesourceFile
and returns the size dimension from itIOException
- if IO exception occurspublic static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension) throws IOException
sourceFile
with resizing it to width
and height
and store the resized image to targetFile
.sourceFile
- source image filetargetFile
- target image filedimension
- image dimensionIOException
- if IO exception occurspublic static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension, String... extraOptions) throws IOException
sourceFile
with resizing it to width
and height
and store the resized image to targetFile
, with appending extraOptions
in the command line if provided.sourceFile
- source image filetargetFile
- target image filedimension
- image dimensionextraOptions
- extra command line optionsIOException
- if IO exception occursCopyright © 2019. All rights reserved.