megabass,
This is a candidate for the Plone Developers Manual.
Once you've distilled this, I suggest that you contribute an example to the Plone Developers Manual
On Fri, Oct 30, 2009 at 4:50 AM, megabass
<[hidden email]> wrote:
Mikko Ohtamaa wrote:
>
> 1. Create a BrowserView for URL from which image is served
>
> 2. Use generic Python knowledge and image library to draw the actual image
> (check Python imaging library)
>
> 3. Instead of serving HTML from your view you send the image data. Python
> imaging library can "save" image to memory using StringIO and you can
> return
> the data of this temporary file-like object.
> request.response.setHeader("Content-type: image/jpeg")
>
> Here is one complex example - it might be too complex to set the main
> points
> in it, but I hope it is something:
>
>
http://code.google.com/p/plonegomobile/source/browse/trunk/gomobile/gomobile.mobile/gomobile/mobile/browser/resizer.py
>
>
Hello Mikko,
thank you very much for your answer and the code example. It's realy pretty
deifficult to understand it without a context.
Could you please explain the third step more detailed.
So I have a browser view and the image object is already generated.
here are some cuts from browser .pt und .py files
pt:
...
[<]span tal:content="view/getImage"[>]Image[<]/span[>]
...
py:
class dashboardView(BrowserView):
"""
dashboard browser view
"""
implements(IdashboardView)
...
def getImage(self):
img = Image.new(mode, size)
#generate the image
...
#how can I return the link to the image object?
#or could you please provide me your solution with the temporary file
Thank very much
Vlad
--
View this message in context: http://n2.nabble.com/Image-vs-ImageField-how-to-post-an-image-object-tp3916101p3917930.html
Sent from the Archetypes mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users
--
SplashStart - Professional Websites. Starting Now.
http://www.splashstart.com
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference_______________________________________________
Archetypes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/archetypes-users