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
|
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 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(File sourceFile,
String sourceMimetype,
File targetFile,
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, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getVersionString
public static final String MIMETYPE_IMAGE_PREFIX
public AbstractImageMagickContentTransformerWorker()
public boolean isAvailable()
ContentTransformerWorker
isAvailable
in interface ContentTransformerWorker
protected void setAvailable(boolean available)
available
- booleanpublic 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.InitializingBean
public static boolean isSupported(String mimetype)
mimetype
- the mimetype to checkpublic boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
isTransformable
in interface ContentTransformerWorker
public String getComments(boolean available)
ContentTransformerHelper
AbstractContentTransformerLimits.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 ContentTransformerWorker
getComments
in class ContentTransformerHelper
available
- 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 ContentTransformerWorker
Exception
transformInternal(File, String, File, String, TransformationOptions)
protected 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 ImageMagickException
Copyright © 2005–2017 Alfresco Software. All rights reserved.