[Zope] python/ retrieving JPG from folder
Garito
garito at sistes.net
Wed Oct 20 04:32:36 EDT 2004
VIGNAUX Philippe wrote:
> 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
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Zope maillist - Zope at zope.org
>http://mail.zope.org/mailman/listinfo/zope
>** No cross posts or HTML encoding! **
>(Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
Hi
I asking myself if you need a product that creates thumbnails automatically
I use Photo and Photo Folder, try it, perhaps it solves your problem
Cheers
More information about the Zope
mailing list