 # create photo.screen_du : a DataURL encoded thumbnail of photo.img
 makeScreenDataURI = (photo, next) ->
 
-    photo.screen_du = resize photo, 1200, 800
+    photo.screen_du = resize photo, 1200, 800, false
 
     next()
 

        photo.img.onload = ->
            next()

resize = (photo, MAX_WIDTH, MAX_HEIGHT) ->
    width = photo.img.width
    height = photo.img.height
    if width > height and height > MAX_HEIGHT
        newWidth = width * MAX_HEIGHT / height
        newHeight = MAX_HEIGHT
    else if width > MAX_WIDTH
        newWidth = MAX_WIDTH
        newHeight = height * MAX_WIDTH / width

    # use canvas to resize the image
    canvas = document.createElement 'canvas'
    canvas.width = MAX_WIDTH
    canvas.height = MAX_HEIGHT
    ctx = canvas.getContext '2d'
    ctx.drawImage photo.img, 0, 0, newWidth, newHeight
    return canvas.toDataURL photo.file.type

blobify = (dataUrl, type) ->

# create photo.thumb_du : a DataURL encoded thumbnail of photo.img
makeThumbDataURI = (photo, next) ->

    photo.thumb_du = resize photo, 100, 100, true
    # let the view update itself
    photo.set 'thumbsrc', photo.thumb_du
    photo.set 'state'   , 'thumbed'
