On Friday, July 19, 2019 at 11:04:25 AM UTC-7, Márcio Luis Dresch wrote:
>
> #this is a copy from
> http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box
>
I'm not sure I agree with Nico, after reading your followup ... is
"ImageUploads" the name of your
#this is a copy from
http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box
#modules\smarthumb.py
from gluon import current
import os
try:
from PIL import Image
except:
import Image
def SMARTHUMB(image, box, fit=True, name="thumb"):
'''Downsample the image.
@param
The example code assumes that the images are in the standard ‘uploads’ folder.
Without looking at at your code, it seems that you defined - in your model file
- the download folder to be ‘imageuploads’. That would explain why the
thumbnail is not found.
Nico de Groot
--
Resources:
-
Hi, I'm new to web2py and am looking for a solution to a problem. The
library is returning a path error while fetching an image for the
thumbnail.
I took the example from:
http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box,
which returns
File "C: \ Users \
4 matches
Mail list logo