[Zope-dev] Generated Images Again

Andrew andrew@apl-software.com
Fri, 12 Nov 1999 15:43:31 -0800


Take a look at the poll product. It does exactly what you want to do.
You might also want to look at my new Photo product which does
something similiar.
http://www.zope.org/Members/Drew/Photo

In essence, your DTML should reference a method that returns an image
object.

<IMG SRC="<dtml-var image/dynamic>">

Where the image object has a method named dynamic that might look like this:

def dynamic(self, arg)
      ...PIL stuff, gd stuff or Imagemagik stuff...
      return StringIO(image_file)
      #image file doesn't need to be a file on the disk
      #but the image should be returned as a string.

I hope that this short explaination is clear.

Drew

----- Original Message -----
From: David S. Harrison <dsh@magma-da.com>
To: Andrew M. Kuchling <akuchlin@mems-exchange.org>
Cc: <zope-dev@zope.org>
Sent: Friday, November 12, 1999 11:48 AM
Subject: Re: [Zope-dev] Generated Images Again


>
>
> "Andrew M. Kuchling" wrote:
> > This isn't invoking your function; read the DTML manual about
> > <dtml-var>.  Instead, try this:
> >
> > <IMG SRC="<dtml-var "GenerateImage(RESPONSE,arg)">">
>
> Well, this successfully calls the function but substitutes
> the bits from the PNG image directly into the <IMG> tag.
> I mean the image tag becomes: '<IMG
SRC="jfdla;jgadjklh32kjhkjhfdkahlfdsa;'g...">'
> where the garbage is the bits from the image.  The browser barfs
> on this in a major way.  Looks like it is still not quite there.
>
> David S. Harrison
> (dsh@magma-da.com)
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
>            No cross posts or HTML encoding!
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>
>