<div>Hi</div> <div> </div> <div>I want to use external methods to read a text file and image in database and modify the REQUEST </div> <div> </div> <div>my code looks like this varible </div> <div>-----------------------</div> <div>def imageSetup(self, imageID, dataID, REQUEST):<BR> import PIL.Image<BR> from StringIO import StringIO</div> <div> </div> <div> # Get the original image and data in memory.<BR> image=getattr(self, imageID)<BR> imageData=getattr(self, dataID)<BR> imageFile=StringIO(str(image.data))<BR> imageDataFile=StringIO(str(imageData.data))</div> <div> # open image and data file<BR> im = PIL.Image.open(imageFile)<BR> tfw = open(imageDataFile, "r")</div> <div> </div> <div> # assign data coordinate and image size to
variables<BR> imX,imY = im.size()<BR> rX=float(tfw.readline())<BR> tfw.readline()<BR> tfw.readline()<BR> rY=float(tfw.readline())<BR> mnX=float(tfw.readline())<BR> mnY=float(tfw.readline())<BR> mxX=mnX+imX*rX<BR> mxY=mnY+imY*rY</div> <div> </div> <div> # assign variables to REQUEST<BR> REQUEST.set('resX', rX)<BR> REQUEST.set('resY', rY)<BR> REQUEST.set('minX', mnX)<BR> REQUEST.set('minY', mnY)<BR> REQUEST.set('maxX', mxX)<BR> REQUEST.set('maxY', mxY)<BR> REQUEST.set('pixelX', imX)<BR> REQUEST.set('pixelY', imY)<BR></div> <div>--------------------------------------</div> <div>but all I get is this</div> <div> </div> <div>zope coercing to Unicode:
need string or buffer, instance found</div> <div> </div> <div>and the REQUEST variable is unchanged</div> <div> </div> <div>I'm still new to external scripting so I don't know what the problem is </div> <div>(and I think there is a lot of it here)</div> <div> </div> <div>so, could someone help me out??</div><p>
        
                <hr size=1> Yahoo! Mail<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/pmall2/*http://photomail.mail.yahoo.com">Use Photomail</a> to share photos without annoying attachments.