Class AbstractImageMagickContentTransformerWorker

  • All Implemented Interfaces:
    ContentTransformerWorker, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
    Direct Known Subclasses:
    ImageMagickContentTransformerWorker

    @Deprecated
    public abstract class AbstractImageMagickContentTransformerWorker
    extends ContentTransformerHelper
    implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
    Deprecated.
    The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.
    Abstract helper for transformations based on ImageMagick
    Author:
    Derek Hulley
    • Field Detail

      • MIMETYPE_IMAGE_PREFIX

        public static final java.lang.String MIMETYPE_IMAGE_PREFIX
        Deprecated.
        the prefix for mimetypes supported by the transformer
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractImageMagickContentTransformerWorker

        public AbstractImageMagickContentTransformerWorker()
        Deprecated.
    • Method Detail

      • setAvailable

        protected void setAvailable​(boolean available)
        Deprecated.
        Make the transformer available
        Parameters:
        available - boolean
      • setRemoteTransformerClient

        public void setRemoteTransformerClient​(RemoteTransformerClient remoteTransformerClient)
        Deprecated.
        Sets the optional remote transformer client which will be used in preference to a local command if available.
        Parameters:
        remoteTransformerClient - may be null;
      • afterPropertiesSet

        public void afterPropertiesSet()
        Deprecated.
        Checks for the JMagick and ImageMagick dependencies, using the common transformation method to check that the sample image can be converted.

        If initialization is successful, then autoregistration takes place.

        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • isSupported

        public static boolean isSupported​(java.lang.String mimetype)
        Deprecated.
        Some image formats are not supported by ImageMagick, or at least appear not to work.
        Parameters:
        mimetype - the mimetype to check
        Returns:
        Returns true if ImageMagic can handle the given image format
      • isTransformable

        public boolean isTransformable​(java.lang.String sourceMimetype,
                                       java.lang.String targetMimetype,
                                       TransformationOptions options)
        Deprecated.
        Supports image to image conversion, but only if the JMagick library and required libraries are available.
        Specified by:
        isTransformable in interface ContentTransformerWorker
      • transformRemote

        protected abstract void transformRemote​(org.alfresco.service.cmr.repository.ContentReader reader,
                                                org.alfresco.service.cmr.repository.ContentWriter writer,
                                                TransformationOptions options,
                                                java.lang.String sourceMimetype,
                                                java.lang.String targetMimetype,
                                                java.lang.String sourceExtension,
                                                java.lang.String targetExtension)
                                         throws java.lang.IllegalAccessException
        Deprecated.
        Throws:
        java.lang.IllegalAccessException
      • transformInternal

        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
        Deprecated.
        Transform the image content from the source file to the target file
        Parameters:
        sourceFile - the source of the transformation
        sourceMimetype - the mimetype of the source of the transformation
        targetFile - the target of the transformation
        targetMimetype - the mimetype of the target of the transformation
        options - the transformation options supported by ImageMagick
        Throws:
        java.lang.Exception