[Zope] ImplicitAcquirerWrapper

Chris McDonough chrism@zope.com
Thu, 06 Jun 2002 08:13:34 -0400


Try this:

def makeThumbnail(self, imagename, width, height):

     # get the original large image
     oriImage = str(getattr(self, imagename))
     ##         ^^ note the str
     # convert it to a file
     oriFile = cStringIO.StringIO(oriImage.data)

Large file objects in Zope have "pdata" data attributes instead of 
strings, this is probably what you're seeing.  Running it through str 
solves the immediate issue.

Antwan Reijnen wrote:
> Hi all,
> 
> I encountered a problem when trying to generate thumbnails from large images. My code is based on a chunk from zopelabs:
> 
> 
> 
> def makeThumbnail(self, imagename, width, height):
> 
>    # get the original large image
>    oriImage = getattr(self, imagename)
>    
>    # convert it to a file  
>    oriFile = cStringIO.StringIO(oriImage.data)
>    
>    ... etcetera
> 
> 
> 
> It seems that oriImage.data is of <type 'string'> when a small image is passed, which is good. When a large image is used, the type of oriImage.data changes to <extension class Acquisition.ImplicitAcquirerWrapper>...
> 
> 
> 
> Is this a memoryproblem? Or even a memorybug? What is this Acquisition.ImplicitAcquirerWrapper class? 
> 
> I use Zope 2.3.3 on Redhat 7.1.
> 
> Appreciate any advice...
> 
> TIA, Antwan.
> 
> 
> 
> Antwan Reijnen
> 
> DEXUS New Media
> Metropole Office 
> Laan van Meerdervoort 70 
> 2517 AN Den Haag
> Tel 070-3114800 
> Fax 070-3656279 
> http://www.dexus.nl
> 
> DEXUS New Media maakt deel uit van de Metropole IT Group 
> http://www.metropole-it.nl 
> 
> ICQ#: 7916222
> 
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


-- 
Chris McDonough                    Zope Corporation
http://www.zope.org             http://www.zope.com
"Killing hundreds of birds with thousands of stones"