Using Alfresco for Image Transformation

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Alfresco for Image Transformation

resplin
Intermediate
0 0 1,839

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Digital Asset Management


Note: Work In Progress


Alfresco can be used for many aspects of Digital Asset Management, including image transformation.  These instructions are written for someone using the Mac OS X operating system.


  1. Install Alfresco 3.0b or greater.
  2. Install/Configure ImageMagick
    1. Determine whether ImageMagick is installed
      1. At the command line, type 'convert'.  This is an ImageMagick utility.  If it is not found, ImageMagick is at the very least not configured (but may be installed)
      2. Check /usr/bin for the convert utility.  If it exists there, ImageMagick is installed on your system.  You may need to update your $PATH to include /usr/bin.  If not, it is either elsewhere on your system or not installed.
    2. If ImageMagick is not installed, install and configure it.  Learn how to do that here: http://www.imagemagick.org/script/binary-releases.php#macosx
  3. Extend the Alfresco content model with an Aspect to support image transformation options.
    1. I did this by adding the following new aspect to the Alfresco content model in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml:

        <aspect name='cm:imageTransformationOptions'>
            <title>Image Transformation Options</title>
            <properties>
                <property name='cm:commandOptions'>
                    <title>Command Options</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                    <default>-1</default>
                </property>
                <property name='cm:resize'>
                    <title>Resize The Image</title>
                    <type>d:boolean</type>
                    <default>false</default>
                </property>
                <property name='cm:resizeWidth'>
                    <title>Resize Width</title>
                    <type>d:int</type>
                    <mandatory>false</mandatory>
                    <default>-1</default>
                </property>
                <property name='cm:resizeHeight'>
                    <title>Resize Height</title>
                    <type>d:int</type>
                    <mandatory>false</mandatory>
                </property>
                <property name='cm:resizeMaintainAspectRatio'>
                    <title>Resize Maintain Aspect Ratio</title>
                    <type>d:boolean</type>
                    <default>true</default>
                </property>
                <property name='cm:resizePercent'>
                    <title>Resize Percent</title>
                    <type>d:boolean</type>
                    <default>false</default>
                </property>
                <property name='cm:resizeToThumbnail'>
                    <title>Resize To Thumbnail</title>
                    <type>d:boolean</type>
                    <default>false</default>
                </property>
            </properties>
        </aspect>

  1. Add the following web client customization in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/extension/web-client-config-custom.xml (see http://wiki.alfresco.com/wiki/Web_Client_Customisation_Guide):

<alfresco-config>

    <config evaluator='aspect-name' condition='cm:imageTransformationOptions'>
        <property-sheet>
            <show-property name='cm:commandOptions' display-label-id='commandOptions' />
            <show-property name='cm:resize' display-label-id='resize' read-only='true' />
            <show-property name='cm:resizeWidth' display-label-id='resizeWidth'/>
            <show-property name='cm:resizeHeight' display-label-id='resizeHeight'/>
            <show-property name='cm:resizeMaintainAspectRatio' display-label-id='resizeMaintainAspectRatio'/>
            <show-property name='cm:resizePercent' display-label-id='resizePercent'/>
            <show-property name='cm:resizeToThumbnail' display-label-id='resizeToThumbnail'/>
        </property-sheet>
    </config>
    <config evaluator='string-compare' condition='Action Wizards'>
        <aspects>
            <aspect name='cm:imageTransformationOptions'/>
        </aspects>
    </config>
</alfresco-config>

  1. Other stuff TBA