public class ImageMagickContentTransformerWorker extends AbstractImageMagickContentTransformerWorker
MIMETYPE_IMAGE_PREFIX, remoteTransformerClienttransformerConfig| 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
|
protected void |
transformRemote(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options,
String sourceMimetype,
String targetMimetype,
String sourceExtension,
String targetExtension) |
getComments, isAvailable, isSupported, isTransformable, remoteTransformerClientConfigured, setAvailable, setRemoteTransformerClient, transformdeprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toStringpublic 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.InitializingBeanafterPropertiesSet in class AbstractImageMagickContentTransformerWorkerprotected void transformInternal(File sourceFile, String sourceMimetype, File targetFile, String targetMimetype, TransformationOptions options) throws Exception
transformInternal in class AbstractImageMagickContentTransformerWorkersourceFile - 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 ImageMagickExceptionprotected void transformRemote(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options,
String sourceMimetype,
String targetMimetype,
String sourceExtension,
String targetExtension)
throws IllegalAccessException
transformRemote in class AbstractImageMagickContentTransformerWorkerIllegalAccessExceptionprotected String getImageMagickVersionNumber()
protected boolean isAlphaOptionSupported()
Copyright © 2005–2018 Alfresco Software. All rights reserved.