 # create photo.thumb_du : a DataURL encoded thumbnail of photo.img
 makeThumbDataURI = (photo, next) ->
     photo.thumb_du = resize photo, 300, 300, true
+    photo.trigger 'thumbed'
     next()
 
 # create photo.screen_du : a DataURL encoded thumbnail of photo.img

        (cb) -> makeThumbDataURI photo, cb
        (cb) ->
            delete photo.img
            cb()
    ], (err) ->
        if err
            photo.trigger 'upError', err
        else
            photo.trigger 'thumbed'

        done(err)

# make screen sized version and upload
uploadWorker = (photo, done) ->
    async.waterfall [
        (cb) -> readFile          photo, cb
        (cb) -> makeScreenDataURI photo, cb
        (cb) -> makeScreenBlob    photo, cb
        (cb) -> makeThumbBlob     photo, cb

            delete photo.thumb_du
            delete photo.scren
            delete photo.screen_du
            setTimeout cb, 200
    ], (err) ->
        if err
            photo.trigger 'upError', err
