[Zope] PIL Question

J. Joy kyroraz@yahoo.com
Sat, 11 May 2002 01:11:11 -0700 (PDT)


--0-626508513-1021104671=:37432
Content-Type: text/plain; charset=us-ascii


I'm trying to create an external method that will take variables that exist in a ZSQL call and will output an image

based on that:  

import Image, ImageDraw, StringIO, os.path

def PILtest():
        image = Image.new('RGB',[25,25])
        ## IMage Stuff Happens here!
        return image

Where this would occur in a DTML-Method of:

<dtml-in SQL_COMMAND>
  <img src="PILtest"> <!--vars to be passed in with this-->
</dtml-in>

But I can't get PILtest to output the image itself.  Save() doesn't seem to be of help directly.  Anyone have any suggestions?

Jason

 



---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
--0-626508513-1021104671=:37432
Content-Type: text/html; charset=us-ascii

<P>I'm trying to create an external method that will take variables that exist in a ZSQL call and will output an image</P>
<P>based on that:&nbsp; </P>
<P>import Image, ImageDraw, StringIO, os.path</P>
<P>def PILtest():<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image = Image.new('RGB',[25,25])<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ## IMage Stuff Happens here!<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return image</P>
<P>Where this would occur in a DTML-Method of:</P>
<P>&lt;dtml-in SQL_COMMAND&gt;<BR>&nbsp; &lt;img src="PILtest"&gt; &lt;!--vars to be passed in with this--&gt;<BR>&lt;/dtml-in&gt;</P>
<P>But I can't get PILtest to output the image itself.&nbsp; Save() doesn't seem to be of help directly.&nbsp; Anyone have any suggestions?</P>
<P>Jason</P>
<P>&nbsp;</P><p><br><hr size=1><b>Do You Yahoo!?</b><br>
<a href="http://rd.yahoo.com/welcome/*http://launch.yahoo.com">LAUNCH</a> - Your Yahoo! Music Experience
--0-626508513-1021104671=:37432--