public class ImageMagickCommandUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
identifyAllMetadata(File sourceFile)
Execute
identify -verbose sub-command and return a string of all extracted metadata from the output. |
static ImageDimension |
identifyDimension(File sourceFile)
Execute
identify sub-command and return an ImageDimension instance from the output. |
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 String identifyAllMetadata(File sourceFile) throws MagickExecuteException, IOException
identify -verbose
sub-command and return a string of all extracted metadata from the output.sourceFile
- source image fileidentify -verbose
sub-command and return a string of all extracted metadata from the outputMagickExecuteException
- if execution exception occursIOException
- if IO exception occurspublic static ImageDimension identifyDimension(File sourceFile) throws MagickExecuteException, IOException
identify
sub-command and return an ImageDimension
instance from the output.sourceFile
- source image fileidentify
sub-command and return an ImageDimension
instance from the outputMagickExecuteException
- if execution exception occursIOException
- if IO exception occurspublic static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension) throws MagickExecuteException, IOException
sourceFile
with resizing it to width
and height
and store the resized image to targetFile
.sourceFile
- source image filetargetFile
- target image filedimension
- image dimensionMagickExecuteException
- if execution exception occursIOException
- if IO exception occurspublic static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension, String... extraOptions) throws MagickExecuteException, 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 optionsMagickExecuteException
- if execution exception occursIOException
- if IO exception occursCopyright © 2019. All rights reserved.