public class ImageMagickImageConverter extends AbstractImageConverter implements ImageConverter
| Modifier and Type | Class and Description |
|---|---|
static class |
ImageMagickImageConverter.Version |
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
excludeFormats |
protected String |
host |
(package private) static Pattern |
IM_VERSION_PATTERN |
protected CommandExecutor.Method |
method |
protected int |
port |
protected boolean |
repageBefore |
(package private) Set<String> |
validFormats |
| Constructor and Description |
|---|
ImageMagickImageConverter() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
color(String c)
Translates MMBase color format (without #) to an convert color format (with or without);
|
long |
convertImage(InputStream input,
String sourceFormat,
OutputStream out,
List<String> commands)
This functions converts an image by the given parameters
|
void |
init(Map<String,String> params)
This function initializes this class
|
protected boolean |
isAnimated(InputStream inp) |
boolean |
isMinimumVersion(int major,
int minor,
int patch)
Test whether the current version of ImageMagick is at least a certain version.
|
static void |
main(String[] args) |
String |
toString() |
convertImageclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitconvertImagestatic final Pattern IM_VERSION_PATTERN
protected CommandExecutor.Method method
protected String host
protected int port
protected boolean repageBefore
public void init(Map<String,String> params)
init in interface ImageConverterinit in class AbstractImageConverterparams - a Map of Strings containing information, this should contain the key's
ImageConvert.ConverterRoot and ImageConvert.ConverterCommand specifying the converter root, and it can also contain
ImageConvert.DefaultImageFormat which can also be 'asis'.ImageConverter.init(java.util.Map)public boolean isMinimumVersion(int major,
int minor,
int patch)
major - minimum major version numberminor - minimum minor version number within the major versionpatch - minimum patch version number within the minor versiontrue if the version is equal to or later than major.minor.patchpublic long convertImage(InputStream input, String sourceFormat, OutputStream out, List<String> commands) throws IOException
convertImage in interface ImageConverterconvertImage in class AbstractImageConverterinput - an array of byte which represents the original imagesourceFormat - original image formatcommands - a List of Strings containing commands which are operations on the image which will be returned.
ImageConvert.converterRoot and ImageConvert.converterCommand specifying the converter root....out - stream of bytes containing the new converted image.IOException - When an error occurs when converting the imageImageConverter.convertImage(java.io.InputStream, java.lang.String, java.io.OutputStream, java.util.List)protected boolean isAnimated(InputStream inp)
protected String color(String c)
c - color to convertMMBase 1.9-SNAPSHOT - ${javadoctimestamp}