Hello all.  When displaying a database stored image it is rotated -90 degs 
from the original.  Any ideas how to rotate this back to normal?  Here is 
the relevant code.

Table:

db.define_table('ball_image',

                Field('image_file', 'upload', uploadfield='picture_file'),

                Field('picture_file', 'blob'),

                Field('queue_id', 'integer'))

Controller:




@auth.requires_login()

def view_queue():

    this_drill_queue = db.drill_queue(request.args(0,cast=int))

    this_sheet = db.sheet(db.sheet.id==this_drill_queue.sheet_id)

    notes = db(db.sheet_note.sheet_id==this_sheet.id).select()

    this_customer = db.customer(db.customer.id==this_sheet.customer_id)

    db.ball_image.queue_id.default = this_drill_queue.id

    form = SQLFORM(db.ball_image)

    if form.process().accepted:

        response.flash='Thanks for uploading an image'

        redirect(URL('view_queue' + '/' + str(this_drill_queue.id)))

    image = db(db.ball_image.queue_id==this_drill_queue.id).select().first()

    return dict(sheet=this_sheet, customer=this_customer,

                drill_queue=this_drill_queue, notes=notes, form=form,

                image=image)


View:

<div class="col-md-6">
                      <h3>
                          Image:
                      </h3>
                      <h4>
                          {{if (image):}}
                              <div class="rot_image">
                                  <img src="{{=URL('default', 'download', 
args=image.image_file)}}" height="200"
                                       width="200" alt="Ball Image" 
style="rotate(90deg)" />
                              </div>
                          {{else:}}
                              <h4>
                                  {{=form.custom.begin}}
                                  {{=form.custom.widget.image_file}}</br>
                                  <div align="right">
                                      <button type="submit" value="submit" 
class="btn btn-primary">Save Image</button></br>
                                  </div>
                                  {{=form.custom.end}}
                              </h4>
                          {{pass}}
                      </h4>
                  </div>




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to