[moin-user] Looping animations in Moin pages

Paul Boddie paul at boddie.org.uk
Sun May 16 10:48:56 EDT 2021


On Sunday, 16 May 2021 02:55:26 CEST Keith Lofstrom wrote:
> I operate a few Moin websites for self-published
> engineering topics (with jsmath equations!).
> 
> In the past, I've added about 50 swf animations that loop
> and repeat; typically rotating or time-evolving 3D objects,
> 10 to 30 second loops, 10 to 30 frames per second.
> 
> I processed directories of full color anti-aliased images
> into shockwave flash, which worked fine in the past.
> SWF is deemed insecure and depreciated now.
> 
> For example, see   http://server-sky.com/IEEESustech2013
> and the attachments for that.  That page is an old version
> of Moin and python; I am building an updated website now.

I don't have Flash installed, so don't see any animations, obviously. However, 
from your C source code which generates the animation frames, it seems that 
these frames are bitmaps exported in PNG format. From the Wikipedia page about 
PNG, it seems that you could just bundle the frames into an animated image in 
APNG format:

https://en.wikipedia.org/wiki/Portable_Network_Graphics#Animation

> What alternative animation format should I use with Moin?

I would recommend APNG based on the above considerations, but if you were to 
produce vector graphics then SVG would probably be worth considering, 
depending on the relationship between individual frames. I use SVG quite a 
bit, and browser support has become decent enough to make its use viable 
without any need to render the images to bitmaps.

> How do I process a directory of images into that format,
> and how do I display the resulting attachment in a Moin
> table window? (code snippet please?)
> 
> What "animations for dummies" web page teaches how to
> create that suggested format?

I don't tend to generate animations, but I imagine that there are tools to 
generate APNG images from collections of individual frames. For instance, you 
might want to look at apngasm, available in Debian:

https://packages.debian.org/buster/apngasm

Project page:

https://sourceforge.net/projects/apngasm/

SVG animations are probably more complicated to construct, and I have no real 
experience with them, but if it is easier to generate each frame separately 
instead of working at the level of individual objects in the animation, then 
SVG might not be the right choice.

> Recently, I learned enough to create mpeg animations that
> make one pass and stop.  I don't know how to make them
> automatically and continuously cycle in a Moin-formatted
> page.  Or how to avoid displaying control buttons.
> I just want to display a looping movie (or two or three)
> in Moin-formatted page frames (typically a table, next
> to descriptive text).
> 
> Suggestions?  Addon python or Moin modules?

This sounds like a matter of just generating the appropriate HTML. Doing that 
within Moin could involve enhancing the built-in functionality, in case that 
doesn't provide the control you need, or writing something like a macro that 
will generate the appropriate HTML.

But judging from the Wikipedia page, I think a plain "img" tag would be able 
to display a looping, animated PNG. For that, the built-in image embedding 
support in Moin would be enough.

Paul




More information about the moin-user mailing list