[Moin-user] Re: Re: Re: Image formatters and UTF8

Jiba jibalamy at free.fr
Fri Feb 10 15:31:05 EST 2006


> > The problem is that doing so (and if i have understood the code well), 
> > i cannot use the MoinMoin cache system... however image generation is 
> > quite slow and thus i need to cache the images !
> 
> The text/python cache system is not meant to handle binary files, it is 
> a system to cache dynamic text, where part of the text is static and 
> part is dynamic. The text is always unicode, and it is encoded to 
> whatever encoding you use for the wiki pages.
> 
> Maybe you describe how your system works - why and how you use your 
> formatter to generate those files.

I'm making a "free trading card game", with downloadable and printable card editable using a wiki. The idea is to have a wiki page for each card, and then to generate the card (in a PNG or JPEG image) using a formatter. Here is a running example (in French) :

http://nekeme.net/~jiba/cgi-bin/moin.cgi/Deichey

When the wiki page is modified, the card image is regenerated (because the cache is no longer valid) and updated to correspond to the contain of the wiki page. The card image is also inserted at the top of the page. You can also get it by using the action "RenderAsPNG" or "RenderAsJpeg".

It currently runs on a patched version of MoinMoin that supports a per-request charset. The image is generated by a formatter, then decoded in Unicode, then stored in the cache, add then (using the patch) re-encoded in binary string and sent to the client.

Jiba




More information about the Moin-user mailing list