box = (200, 200), should
box = (200, 200) (remove the extra comma :-)) On Thursday, 3 October 2019 06:19:51 UTC-7, Maurice Waka wrote: > > I followed this > <http://www.web2pyslices.com/slice/show/1387/upload-image-and-make-a-thumbnail> > > example with this code > db.define_table('article', > Field("title"), > Field("article_text", "text"), > Field("picture", "upload"), > Field("thumbnail", "upload") > ) > from images import THUMB > from smarthumb import SMARTHUMB > box = (200, 200), > db.article.thumbnail.compute = lambda row: SMARTHUMB(row.picture, box) > > > db.define_table('uploads', > Field('name','string'), > Field('mainfile','upload'), > Field('thumb','upload',writable=False,readable=False), > ) > > I get this error: > > > File "/home/mauricewaka/web2py/applications/bot/modules/smarthumb.py", > line 21, in SMARTHUMB > while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / factor > 2 > * box[1]: > TypeError: '>' not supported between instances of 'float' and 'tuple' > > > My path is: > > img = Image.open(request.folder + '/uploads/' + image) > > > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/148602c9-13eb-4e0b-91bd-2360149cfd5b%40googlegroups.com.

