public class ImageMagickHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ENV_PATH
the environment variable to check for imagemagick.
|
protected static Boolean |
m_ConvertPresent
whether "convert" is present.
|
Constructor and Description |
---|
ImageMagickHelper() |
Modifier and Type | Method and Description |
---|---|
protected static String |
getMissingCommandErrorMessage(String cmd)
Returns a standard error message if specifiec command is not available.
|
static String |
getMissingConvertErrorMessage()
Returns a standard error message if "convert" is not available.
|
static boolean |
isConvertAvailable()
Checks whether the "convert" utility is available.
|
static void |
main(String[] args)
Just outputs some information on availability of tools.
|
static BufferedImage |
read(File file)
Reads a BufferedImage from the file.
|
static BufferedImage |
read(InputStream stream)
Reads a BufferedImage from the stream.
|
static BufferedImage |
read(URL url)
Reads a BufferedImage from a URL.
|
public static final String ENV_PATH
protected static Boolean m_ConvertPresent
public static boolean isConvertAvailable()
protected static String getMissingCommandErrorMessage(String cmd)
cmd
- the command to use in error message, e.g., "convert"public static String getMissingConvertErrorMessage()
public static BufferedImage read(File file)
file
- the file to read the image frompublic static BufferedImage read(URL url)
url
- the URL to read the image frompublic static BufferedImage read(InputStream stream)
stream
- the stream to read the image frompublic static void main(String[] args)
args
- ignoredCopyright © 2021 University of Waikato, Hamilton, NZ. All Rights Reserved.