public class ImageMagickContentTransformerWorker extends AbstractImageMagickContentTransformerWorker
MIMETYPE_IMAGE_PREFIX
transformerConfig
Constructor and Description |
---|
ImageMagickContentTransformerWorker()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Checks for the JMagick and ImageMagick dependencies, using the common
transformation method to check
that the sample image can be converted. |
protected String |
getImageMagickVersionNumber() |
String |
getVersionString()
Gets the version string captured from the check command.
|
protected boolean |
isAlphaOptionSupported() |
void |
setCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)
Sets the command that must be executed in order to retrieve version information from the converting executable
and thus test that the executable itself is present.
|
void |
setExecuter(org.alfresco.util.exec.RuntimeExec executer)
Set the runtime command executer that must be executed in order to run
ImageMagick.
|
protected void |
transformInternal(File sourceFile,
String sourceMimetype,
File targetFile,
String targetMimetype,
TransformationOptions options)
Transform the image content from the source file to the target file
|
getComments, isAvailable, isSupported, isTransformable, setAvailable, transform
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toString
public ImageMagickContentTransformerWorker()
public void setExecuter(org.alfresco.util.exec.RuntimeExec executer)
The command must contain the variables ${source}
and
${target}
, which will be replaced by the names of the file to
be transformed and the name of the output file respectively.
convert ${source} ${target}
executer
- the system command executerpublic void setCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)
checkCommand
- command executer to retrieve version informationpublic String getVersionString()
public void afterPropertiesSet()
transformation method
to check
that the sample image can be converted.afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class AbstractImageMagickContentTransformerWorker
protected void transformInternal(File sourceFile, String sourceMimetype, File targetFile, String targetMimetype, TransformationOptions options) throws Exception
transformInternal
in class AbstractImageMagickContentTransformerWorker
sourceFile
- the source of the transformationsourceMimetype
- the mimetype of the source of the transformationtargetFile
- the target of the transformationtargetMimetype
- the mimetype of the target of the transformationoptions
- the transformation options supported by ImageMagickException
protected String getImageMagickVersionNumber()
protected boolean isAlphaOptionSupported()
Copyright © 2005–2017 Alfresco Software. All rights reserved.