def view_image():
 try:
  _id = request.args[0]
 except:
  return 'Need to provide the id of the Image'
 table = s3db.doc_image
 record = db((table.id == _id)).select(table.name, table.file, table.comments, limitby=(0, 1)).first()
 desc = DIV(record.comments, _class='imageDesc')
 filename = record.name
 url = URL(c='default', f='download', args=record.file)
 alt = (record.comments if record.comments else filename)
 image = IMG(_src=url, _alt=alt)
 output = Storage(image=image, desc=desc)
 return output

def view_image ( ) : try : _id = request . args [ 0 ] except : return 'Need to provide the id of the Image' table = s3db . doc_image record = db ( ( table . id == _id ) ) . select ( table . name , table . file , table . comments , limitby = ( 0 , 1 ) ) . first ( ) desc = DIV ( record . comments , _class = 'imageDesc' ) filename = record . name url = URL ( c = 'default' , f = 'download' , args = record . file ) alt = ( record . comments if record . comments else filename ) image = IMG ( _src = url , _alt = alt ) output = Storage ( image = image , desc = desc ) return output
view a fullscreen version of an image - called from reports .