     width = Math.round(width)
     height = Math.round(height)
 
-    ### Set the canvas to the image size we want. ###
-
+    # Set the canvas to the image size we want.
     canvas = @canvas
     canvas.width = width
     canvas.height = height
 
-    ### Blit the image onto the canvas. ###
-
+    # Blit the image onto the canvas.
     ctx = canvas.getContext('2d')
 
-    ### Clear the canvas, so check_image_contents can check that the data was correctly loaded. ###
-
+    # Clear the canvas, so check_image_contents can check that the data was correctly loaded.
     ctx.clearRect 0, 0, canvas.width, canvas.height
     ctx.drawImage @image, 0, 0, canvas.width, canvas.height
     if !@check_image_contents()

###
# file must be a Blob object.  Create and return a thumbnail of the image.
# Perform an image search using post/similar.
#

  form_submit_event: (e) ->
    post_file = @form.down('#file')

    # If the files attribute isn't supported, or we have no file (source upload), use regular
    # form submission.
    if !post_file.files? or post_file.files.length == 0
      return

    # If we failed to load the image last time due to a silent Chrome error, continue with
    # the submission normally this time.
    file = post_file.files[0]
    if @force_file and @force_file == file
      @force_file = null
