Sorry everyone. After running more tests, the image is getting rotated for
some reason in the email. My process was to take a picture with my phone
and email it to my computer. Sorry for the false alarm.
On Monday, April 4, 2016 at 1:44:19 PM UTC-5, Jeff Riley wrote:
>
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.