Class GraphicsMagickCommandUtils
java.lang.Object
org.onehippo.forge.gallerymagick.core.command.GraphicsMagickCommandUtils
Utility to run Graphics Magick Commands.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringidentifyAllMetadata(File sourceFile) Executeidentify -verbosesub-command and return a string of all extracted metadata from the output.static ImageDimensionidentifyDimension(File sourceFile) Executeidentifysub-command and return anImageDimensioninstance from the output.static voidresizeImage(File sourceFile, File targetFile, ImageDimension dimension) Resize the given imagesourceFilewith resizing it towidthandheightand store the resized image totargetFile.static voidresizeImage(File sourceFile, File targetFile, ImageDimension dimension, String... extraOptions) Resize the given imagesourceFilewith resizing it towidthandheightand store the resized image totargetFile, with appendingextraOptionsin the command line if provided.
-
Method Details
-
identifyAllMetadata
public static String identifyAllMetadata(File sourceFile) throws MagickExecuteException, IOException Executeidentify -verbosesub-command and return a string of all extracted metadata from the output.- Parameters:
sourceFile- source image file- Returns:
- Execute
identify -verbosesub-command and return a string of all extracted metadata from the output - Throws:
MagickExecuteException- if execution exception occursIOException- if IO exception occurs
-
identifyDimension
public static ImageDimension identifyDimension(File sourceFile) throws MagickExecuteException, IOException Executeidentifysub-command and return anImageDimensioninstance from the output.- Parameters:
sourceFile- source image file- Returns:
- Execute
identifysub-command and return anImageDimensioninstance from the output - Throws:
MagickExecuteException- if execution exception occursIOException- if IO exception occurs
-
resizeImage
public static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension) throws MagickExecuteException, IOException Resize the given imagesourceFilewith resizing it towidthandheightand store the resized image totargetFile.- Parameters:
sourceFile- source image filetargetFile- target image filedimension- image dimension- Throws:
MagickExecuteException- if execution exception occursIOException- if IO exception occurs
-
resizeImage
public static void resizeImage(File sourceFile, File targetFile, ImageDimension dimension, String... extraOptions) throws MagickExecuteException, IOException Resize the given imagesourceFilewith resizing it towidthandheightand store the resized image totargetFile, with appendingextraOptionsin the command line if provided.- Parameters:
sourceFile- source image filetargetFile- target image filedimension- image dimensionextraOptions- extra command line options- Throws:
MagickExecuteException- if execution exception occursIOException- if IO exception occurs
-