 
 config = require '../config'
 crypto = require 'crypto'
+DeepZoomImage = require 'deepzoomtools'
+DZIParser = require './dziparser'
 FS = require 'fs-extra'
 OS = require 'os'
 Path = require 'path'


     req.pipe file


## MAIN:


        dir = makeTempDir _

        # Download the content to a file (within our temp dir) named by the ID:
        file = Path.join dir, content.id
        echo 'Downloading content to temp dir... id=%j, file=%j', id, file
        downloadFile content.url, file, _

        echo 'Generating DZI for content... id=%j', id
        dzi = createDZI file, _

        echo 'Parsing the generated DZI... id=%j', id
        dzi = DZIParser.parse dzi, _

        # TODO: Upload!

        # erro 'Success! Marking content as ready... id=%j', id
        # content.markReady dzi, _
