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
|
| 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. |
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.io.File targetFile,
TransformationOptions options)
Transform the image content from the source file to the target file
|
getMimetype, getMimetypeService, isExplicitTransformation, isSupportedTransformation, setExplicitTransformations, setMimetypeService, setSupportedTransformationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 ContentTransformerWorkerContentTransformer.isTransformable(String, String, TransformationOptions)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.io.File targetFile,
TransformationOptions options)
throws java.lang.Exception
sourceFile - the source of the transformationtargetFile - the target of the transformationoptions - the transformation options supported by ImageMagickjava.lang.ExceptionCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.