public abstract class AbstractImageMagickContentTransformerWorker extends ContentTransformerHelper implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description |
|---|---|
static String |
MIMETYPE_IMAGE_PREFIX
the prefix for mimetypes supported by the transformer
|
protected RemoteTransformerClient |
remoteTransformerClient |
transformerConfig| Constructor and Description |
|---|
AbstractImageMagickContentTransformerWorker() |
| 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. |
String |
getComments(boolean available)
Overridden to supply a comment or String of commented out transformation properties
that specify any (hard coded or implied) supported transformations.
|
boolean |
isAvailable()
Checks if this worker is available.
|
static boolean |
isSupported(String mimetype)
Some image formats are not supported by ImageMagick, or at least appear not to work.
|
boolean |
isTransformable(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Supports image to image conversion, but only if the JMagick library and required
libraries are available.
|
protected boolean |
remoteTransformerClientConfigured() |
protected void |
setAvailable(boolean available)
Make the transformer available
|
void |
setRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)
Sets the optional remote transformer client which will be used in preference to a local command if available.
|
void |
transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options) |
protected abstract 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 abstract 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) |
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetVersionStringpublic static final String MIMETYPE_IMAGE_PREFIX
protected RemoteTransformerClient remoteTransformerClient
public AbstractImageMagickContentTransformerWorker()
public boolean isAvailable()
ContentTransformerWorkerisAvailable in interface ContentTransformerWorkerprotected void setAvailable(boolean available)
available - booleanpublic void setRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)
remoteTransformerClient - may be null;protected boolean remoteTransformerClientConfigured()
public void afterPropertiesSet()
transformation method to check
that the sample image can be converted.
If initialization is successful, then autoregistration takes place.
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic static boolean isSupported(String mimetype)
mimetype - the mimetype to checkpublic boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
isTransformable in interface ContentTransformerWorkerpublic String getComments(boolean available)
ContentTransformerHelperAbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions)
or ContentTransformerWorker.isTransformable(String, String, TransformationOptions)
have been overridden.
See ContentTransformerHelper.getCommentsOnlySupports(List, List, boolean) which may be used to help construct a comment.getComments in interface ContentTransformerWorkergetComments in class ContentTransformerHelperavailable - indicates if the transformer has been registered and is available to be selected.
false indicates that the transformer is only available as a component of a
complex transformer.ContentTransformer.getComments(boolean)public final void transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
throws Exception
transform in interface ContentTransformerWorkerExceptiontransformInternal(File, String, File, String, TransformationOptions)protected abstract 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
IllegalAccessExceptionprotected abstract void transformInternal(File sourceFile, String sourceMimetype, File targetFile, String targetMimetype, TransformationOptions options) throws Exception
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 ImageMagickExceptionCopyright © 2005–2018 Alfresco Software. All rights reserved.