public class ImageMagickContentTransformerWorker
extends org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorker
executer, fileDetailsExecuter, VAR_SOURCE, VAR_TARGET, versionDetailsExecuter| Constructor and Description |
|---|
ImageMagickContentTransformerWorker()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected List<File> |
getMultipleTargetSiblings(File targetFile)
Gets the any siblings in the same directory as the targetFile with the same name
prefix used by ImageMagick for multiple outputs.
|
protected void |
initializationTest() |
protected void |
initializeExecuter() |
protected void |
initializeFileDetailsExecuter() |
protected void |
initializeVersionDetailsExecuter() |
protected boolean |
isSupported(String mediaType)
Some image formats are not supported by ImageMagick, or at least appear not to work.
|
boolean |
isTransformable(List<String> sourceMediaTypes,
String targetMediaType,
org.gytheio.content.transform.options.TransformationOptions options) |
void |
setExecuter(org.gytheio.util.exec.RuntimeExec executer)
Set the runtime command executer that must be executed in order to run
ImageMagick.
|
protected void |
singleTransformInternal(org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair sourcePair,
org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair targetPair,
org.gytheio.content.transform.options.TransformationOptions options,
org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter)
Transform the image content from the source file to the target file.
|
protected List<File> |
transformInternal(List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> sourcePairs,
List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> targetPairs,
org.gytheio.content.transform.options.TransformationOptions options,
org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) |
getDetails, initialize, initializeVersionDetailsString, setVersionDetailsExecutercreateTargetContentReference, createTempFile, getSourcePairs, getTargetPairs, initializationTest, isTempTargetUsed, transform, transformgetExtension, setTargetContentReferenceHandler, toStringgetProperties, getVersionDetailsString, getVersionString, initializeVersionString, isAvailable, loadProperties, setIsAvailable, setSourceContentReferenceHandlerpublic ImageMagickContentTransformerWorker()
public void setExecuter(org.gytheio.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}
setExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerexecuter - the system command executerprotected void initializeExecuter()
initializeExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializeVersionDetailsExecuter()
initializeVersionDetailsExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializeFileDetailsExecuter()
initializeFileDetailsExecuter in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected void initializationTest()
initializationTest in class org.gytheio.content.transform.AbstractRuntimeExecContentTransformerWorkerprotected boolean isSupported(String mediaType)
mediaType - the mimetype to checkpublic boolean isTransformable(List<String> sourceMediaTypes, String targetMediaType, org.gytheio.content.transform.options.TransformationOptions options)
protected List<File> transformInternal(List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> sourcePairs, List<org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair> targetPairs, org.gytheio.content.transform.options.TransformationOptions options, org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter) throws Exception
transformInternal in class org.gytheio.content.transform.AbstractFileContentTransformerWorkerExceptionprotected void singleTransformInternal(org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair sourcePair,
org.gytheio.content.transform.AbstractFileContentTransformerWorker.FileContentReferencePair targetPair,
org.gytheio.content.transform.options.TransformationOptions options,
org.gytheio.content.transform.ContentTransformerWorkerProgressReporter progressReporter)
throws Exception
Note that ImageMagick may create multiple outputs for paged file types if no page limit or paged source options are present in the transformation options to constrain that behavior.
sourcePair - targetPair - options - progressReporter - Exceptionprotected List<File> getMultipleTargetSiblings(File targetFile)
For example, when requesting a conversion of a 2 page PDF to JPEG: convert source.pdf result.jpg ImageMagick will create: result-0.jpg result-1.jpg
targetFile - Copyright © 2015 Alfresco Software. All rights reserved.