Hi,

yes I use this function:

def makeThumbnail(dbtable,ImageID,size=(150,150)):
    try:
        thisImage=db(dbtable.id==ImageID).select()[0]
        import os, uuid
        from PIL import Image
    except: return
    if thisImage.image == "":
        return
    im=Image.open(request.folder + 'uploads/' + thisImage.image)
    im.thumbnail(size,Image.ANTIALIAS)
    thumbName='product.image.%s.jpg' % (uuid.uuid4())
    im.save(request.folder + 'uploads/' + thumbName,'jpeg')
    thisImage.update_record(thumbnail=thumbName)
    return


Den onsdagen den 1:e oktober 2014 kl. 21:53:53 UTC+3 skrev Anthony:
>
> Looks like something is wrong with the filename. It should be of the form:
>
> [tablename].[fieldname].[first 16 characters of UUID].[b16encoded original 
> filename].[extension]
>
> Instead, it looks like it includes a full (non-truncated) UUID and no 
> b16encoded filename. Was the file originally stored via a custom_store 
> method?
>
> Anthony
>
> On Wednesday, October 1, 2014 12:27:46 AM UTC-4, Kenneth wrote:
>>
>> Hello,
>>
>> TAG.img(_height=50, _src=URL(r=request, c='default', f='download', 
>> args=[value]))
>>
>> gives me:
>>
>> <type 'exceptions.TypeError'> Can't retrieve 
>> product.image.4dfd23fe-ba46-43a0-9def-6bdbc929a68c.jpg
>>
>>
>> This has worked before, the problem is that I have no idea when this has 
>> stopped working, migth be years. The product.image.4dfd23fe file does exist 
>> in uploads folder. 
>>
>>
>> Kenneth
>>
>>
>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to