[Zope] python/ retrieving JPG from folder

VIGNAUX Philippe philippe.vignaux at africamuseum.be
Wed Oct 20 04:25:14 EDT 2004


Hi all !

 

My zope config :   Zope 2.6.4 (binary release, python2.1, win32-x86)

 

 

I want to read the content of a folder (localfs) that contains pictures
(JPG) to create thumbnails for these pictures.

Nb : < remote > is the name of my zope local file system.

 

 

for item in context.remote.fileValues():

    print item.id

return printed

 

gives as result :

Chateau.jpg

Paradise.jpg

Which is right.

 

 

 

 

for item in context.remote.fileValues():

    context.makethumbnail(item)

 

gives the error message that you find below.  (attribute error   read)

 

The < makethumbnail >  external method has been tested and works FINE !

If I give as parameter for this method the result of  <input type="file"
name=  ...... >, a thumnail is well created.

 

So the problem is :  what's the right way to give the picture itself
listed in the folder contents,  as parameter in my python code     ????

 

Any help greatly appreciated !

 

Regards,

 

Philippe.

 

 

 

Exception Type

AttributeError

Exception Value

read

Traceback (innermost last): 

*	Module ZPublisher.Publish, line 98, in publish 
*	Module ZPublisher.mapply, line 88, in mapply 
*	Module ZPublisher.Publish, line 39, in call_object 
*	Module Shared.DC.Scripts.Bindings, line 252, in __call__ 
*	Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec 
*	Module Products.PythonScripts.PythonScript, line 314, in _exec 
*	Module Script (Python), line 3, in test
	<PythonScript at /afrigeopict/test>
	Line 3 
*	Module Products.ExternalMethod.ExternalMethod, line 231, in
__call__
	__traceback_info__: ((<LocalFile instance at 02D75CC8>,), {},
(100,)) 
*	Module C:\PROGRA~1\zopedb01\Extensions\thumbnail.py, line 8, in
makethumbnail 
*	Module PIL.Image, line 1547, in open 

AttributeError: read 

 

###########################################

This message has been scanned by ICT - Africa Museum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20041020/269b74da/attachment-0001.htm


More information about the Zope mailing list