public abstract class AbstractImageMagickContentTransformerWorker extends ContentTransformerHelper implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MIMETYPE_IMAGE_PREFIX
the prefix for mimetypes supported by the transformer
|
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. |
java.lang.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(java.lang.String mimetype)
Some image formats are not supported by ImageMagick, or at least appear not to work.
|
boolean |
isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Supports image to image conversion, but only if the JMagick library and required
libraries are available.
|
protected void |
setAvailable(boolean available)
Make the transformer available
|
void |
transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options) |
protected abstract void |
transformInternal(java.io.File sourceFile,
java.lang.String sourceMimetype,
java.io.File targetFile,
java.lang.String targetMimetype,
TransformationOptions options)
Transform the image content from the source file to the target file
|
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 java.lang.String MIMETYPE_IMAGE_PREFIX
public AbstractImageMagickContentTransformerWorker()
public boolean isAvailable()
ContentTransformerWorkerisAvailable in interface ContentTransformerWorkerprotected void setAvailable(boolean available)
available - 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(java.lang.String mimetype)
mimetype - the mimetype to checkpublic boolean isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
isTransformable in interface ContentTransformerWorkerpublic java.lang.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 java.lang.Exception
transform in interface ContentTransformerWorkerjava.lang.Exception#transformInternal(File, File)protected abstract void transformInternal(java.io.File sourceFile,
java.lang.String sourceMimetype,
java.io.File targetFile,
java.lang.String targetMimetype,
TransformationOptions options)
throws java.lang.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 ImageMagickjava.lang.ExceptionCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.