Re: [web2py] Re: Resizing a user uploaded image

2014-08-09 Thread lyn2py
Did you manage to figure this out? I am trying out the gluon/ contrib/ imageutils and it isn't working for me either. The db.table_name.picture.requires = RESIZE(200, 200) and db.table_name.thumbnail.compute = lambda row: THUMB(row.picture, 200, 200) Both are not working for me. Instead the

Re: [web2py] Re: Resizing a user uploaded image

2013-01-09 Thread Daniele Pestilli
No, just regular web2py webserver on my machine. Jan 9, 2013 2:36 AM、Bruno Rocha のメッセージ: > are you running on Google App Engine? > -- > > > --

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Bruno Rocha
are you running on Google App Engine? --

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
It seems to be uploading the full-sized image properly but for the thumb it says 'thumbnail': None where thumbnail is the field name in the db.py file. On Wed, Jan 9, 2013 at 1:06 AM, Daniele Pestilli wrote: > Hmm still not working. > I'm wondering if this is the problem: > > uploadfolder=os.pat

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
Hmm still not working. I'm wondering if this is the problem: uploadfolder=os.path.join(request.folder, 'uploads', 'profiles', 'thumbs') should it be uploadfolder=os.path.join(request.folder, 'uploads', 'profiles/thumbs') or something? On Wed, Jan 9, 2013 at 12:43 AM, Bruno Rocha wrote: > Yeah

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Bruno Rocha
Yeah it is a problem in THUMB function, thumb function looks for files under /uploads and you are defining another folder. change the imageutils module replacing /uploads with /uploads/profile On Tue, Jan 8, 2013 at 9:30 PM, Daniele Pestilli wrote: > I put imageutils in my app's modules director

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Daniele Pestilli
I put imageutils in my app's modules directory, then I added: Field("thumbnail", "upload", uploadfolder=os.path.join(request.folder, 'uploads', 'profiles', 'thumbs')), to the appropriate database table, and below that, in the same file (db.py) I wrote: from imageutils import THUMB db.tutor.thumbna

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Michele Comitini
I use wand for the task: http://pypi.python.org/pypi/Wand/0.1.10 there are many other bindings on the impressive *magick libraries, but this one being a ctypes implementation is light and fast enough.. mic 2013/1/8 Bruno Rocha : > I am using this recipe: > > http://www.web2pyslices.com/slice/sho

Re: [web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Bruno Rocha
I am using this recipe: http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box I have plans to integrate it with a JavaScript Cropper plugin to get the dimensions. --

[web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Derek
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

[web2py] Re: Resizing a user uploaded image

2013-01-08 Thread Derek
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 a