They made it even simpler now... (look at contrib/imageutils.py)
#
# Put this file in yourapp/modules/images.py
#
# Given the model
#
# db.define_table("table_name", Field("picture", "upload"),
Field("thumbnail", "upload"))
#
# # to resize the picture on upload
#
# from images import RESIZE
#
# db.table_name.picture.requires = RESIZE(200, 200)
#
# # to store original image in picture and create a thumbnail in
'thumbnail' field
#
# from images import THUMB
# db.table_name.thumbnail.compute = lambda row: THUMB(row.picture, 200, 200)
On Tuesday, January 8, 2013 12:03:37 PM UTC-7, Derek wrote:
>
> Take a look here for a somewhat similar example...
>
>
> http://www.web2pyslices.com/slice/show/1387/upload-image-and-make-a-thumbnail
>
> You'll need the PIL (python image library) installed.
>
> On Tuesday, January 8, 2013 11:43:36 AM UTC-7, Daniele wrote:
>>
>> How can i make it so that when a user uploads an image, it automatically
>> gets resized to a specified dimension?
>>
>> Thanks!
>>
>
--