If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!
Commented on:
In this recipe you will see how to create a custom computation to create a thumbnail to fit centered in a specific box
Hosting graciously provided by:
1
ilvalle 12 years ago
I've defined the upload field with the options uploadseparate=True, uploadfolder=request.folder+'uploads/pictures'
It would be nice to integrate automatically this two options, so far I changed the code as follows (is not the best way but it works):
try:
img = Image.open(request.folder + 'uploads/pictures/' + image)
except:
try:
splits = image.split('.')
path = splits[0] + '.' + splits[1] + '/' + splits[2][:2] + '/'
global_path = request.folder + 'uploads/pictures/' + path + image
img = Image.open(request.folder + 'uploads/pictures/' + path + image)
except:
return image
[...]
Paolo
replies (2)