public class DefaultImageMagickService extends BasicImageMagickStrategy implements ImageMagickService
ImageMagickService backed by ImageMagick
.
Both ImageMagick executable (convert and identify in use will be executed by the auto
injected ProcessExecutor.
| Property | Meaning | Default |
|---|---|---|
imagemagick.bindir |
The binary directory of your local image magick installation. | *|
imagemagick.executable.convert |
The convert executable to call. |
convert |
imagemagick.executable.identify |
The identify executable to call. |
identify |
imagemagick.configuration.directory |
Path to the Configuration directory to use. | Lookup sequence is as follows:
|
Note: all environment variables relevant to ImageMagick will be forwarded to the executed process when set in the JVM environment.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONVERT_EXEC
Executable name to be used with the
IMAGEMAGICK_EXECUTABLE_KEY_PREFIX conf key prefix. |
static String |
EMBEDDED_BIN_DIR
Deprecated.
|
static String |
IDENTIFY_EXEC
Executable name to be used with the
IMAGEMAGICK_EXECUTABLE_KEY_PREFIX conf key prefix. |
static String |
IMAGEMAGICK_DIR
Property key for the binary directory to use (overrides build in mechanism).
|
static String |
IMAGEMAGICK_EXECUTABLE_KEY_PREFIX
Configuration key prefix for the executable name to use.
|
EMBEDDED_CONFIG_DIR, IMAGEMAGICK_CONFIGURATION_DIRECTORY| Constructor and Description |
|---|
DefaultImageMagickService() |
| Modifier and Type | Method and Description |
|---|---|
protected String[] |
buildEnvironment(File executable)
Assembling image magick environment.
|
void |
convert(List<String> commandOpts)
Executes a conversion with the specified list of options.
|
OsConfigurationService |
getOsConfigurationService() |
ProcessExecutor |
getProcessExecutor() |
String |
identify(List<String> commandOptions)
Executes image identification with the specified options.
|
void |
setOsConfigurationService(OsConfigurationService osDirectoryService) |
void |
setProcessExecutor(ProcessExecutor processExecutor) |
getConfigurationDirectory, getConfigurationService, getTmpDir, setConfigurationDirectory, setConfigurationService, setTmpDir@Deprecated public static final String EMBEDDED_BIN_DIR
public static final String IMAGEMAGICK_DIR
public static final String IMAGEMAGICK_EXECUTABLE_KEY_PREFIX
CONVERT_EXEC,
IDENTIFY_EXEC,
Constant Field Valuespublic static final String CONVERT_EXEC
IMAGEMAGICK_EXECUTABLE_KEY_PREFIX conf key prefix. This property key
is used to have an indirection if a different executable should be used.public static final String IDENTIFY_EXEC
IMAGEMAGICK_EXECUTABLE_KEY_PREFIX conf key prefix. This property key
is used to have an indirection if a different executable should be used.protected String[] buildEnvironment(File executable) throws IOException
executable - the executable to useIOExceptionpublic void convert(List<String> commandOpts) throws IOException
ImageMagickServiceconvert in interface ImageMagickServicecommandOpts - the bold command line options (including input and output files if applicable).IOException - on any errorpublic String identify(List<String> commandOptions) throws IOException
ImageMagickServiceidentify in interface ImageMagickServicecommandOptions - bold command line options to the identify command (including the input file).IOException - on any error.public ProcessExecutor getProcessExecutor()
public void setProcessExecutor(ProcessExecutor processExecutor)
public OsConfigurationService getOsConfigurationService()
public void setOsConfigurationService(OsConfigurationService osDirectoryService)
Copyright © 2017 SAP SE. All Rights Reserved.