Transmogrify 1.0.1b2 documentation

Installation

Install optional Pillow requirements

Pillow requires certain native libraries in order to decode certain types of files.

Typically you will need these libraries (these are the Ubuntu names):

  • libjpeg
  • libjpeg-dev
  • libfreetype6
  • libfreetype6-dev
  • zlib1g-dev

If you want Transmogrify to also better handle the conversion of CMYK images to RGB, you need to add littleCMS libaries.

  • liblcms
  • liblcms-dev
  • liblcms-utils

Example:

# sudo apt-get install python-dev libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk

Install Transmogrify

Create a “home” for transmogrify

# mkdir -p /etc/transmogrify
# cd /etc/transmogrify

Download the setuptools and pip wheels

# mkdir virtualenv_support
# cd virtualenv_support/
# sudo wget https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.6-py2.py3-none-any.whl#md5=4d4fb4b69df6731c7aeaadd6300bc1f2
# sudo wget https://pypi.python.org/packages/3.4/s/setuptools/setuptools-8.2-py2.py3-none-any.whl#md5=44a36e437d09e3eb125a14c3a428b0f8
# cd ..

Download and run the bootstrap program:

# curl https://raw.github.com/callowayproject/Transmogrify/master/bootstrap.py | python

You can install the latest development release using this command:

# curl https://raw.github.com/callowayproject/Transmogrify/master/bootstrap.py --dev | python

These create a python virtualenv and installs Transmogrify.

Create settings file

  1. Execute source virtualenv/bin/activate to activate the Transmogrify’s virtualenv.
  2. Execute configure_transmogrify
  3. Answer the questions.
Specify your Secret Key, or use this random key [p9pmpo)-l@c=ux06#ucezz@t4f1j6*_re%-area6xk&_ic#u0r]:
Where are your original files stored [/etc/transmogrify/originals]:
Where will your modified files be stored [/etc/transmogrify/modified]:
Where would you like to store the settings [transmogrify_settings.py]:

Install OpenCV

  1. Execute source virtualenv/bin/activate to activate the Transmogrify’s virtualenv.
  2. I’m using instructions found at http://karytech.blogspot.com/2012/05/opencv-24-on-ubuntu-1204.html to install the latest version.

Install WSGI server

Gunicorn

  1. Make a file called /etc/transmogrify/conf/gunicorn_conf.py

    NAME = 'transmogrify'
    bind = "unix:///var/run/%s.sock" % NAME
    pidfile = "/var/run/%s.pid" % NAME
    user = "www-data"
    group = "www-data"
    accesslog = "/var/log/gunicorn/%s.access.log" % NAME
    errorlog = "/var/log/gunicorn/%s.error.log" % NAME
    proc_name = NAME
    
  2. Create a script called /etc/transmogrify/transmogrify

    #!/bin/bash
    HOMEDIR="/etc/transmogrify"
    CONF="$HOMEDIR/conf/gunicorn_conf.py"
    NAME=transmogrify
    cd $HOMEDIR
    source virtualenv/bin/activate
    TRANSMOGRIFY_SETTINGS=transmogrify_settings exec $HOMEDIR/virtualenv/bin/python \
       /etc/transmogrify/virtualenv/bin/gunicorn \
       --config $CONF transmogrify.wsgi:app
    
  3. Make the script executable

    # chmod a+x transmogrify
    
  4. Make a startup script

    description "Transmogrify"
    start on runlevel [2345]
    stop on runlevel [06]
    respawn
    respawn limit 10 5
    
    script
        /etc/transmogrify/transmogrify
    end script
    

uWSGI

Change Permissions

  1. sudo chown -r www-data:www-data /etc/transmogrify