Page MenuHomePhabricator

webp images on commons do not show duration if animated
Open, Needs TriagePublic

Description

See this example:

https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=mime|size|metadata&titles=File:Simple_Animated_Clock.webp&format=json

animated is true, in browser it shows the animation. But there is no duration metadata available (nor as metadata, nor as duration field of imageinfo itself).

I think this should be added. To match support for png:

https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=mime|size|metadata&titles=File:Simple_Animated_Clock.png&format=json

Event Timeline

The reason it is not in there is because that is not metadata information provided by the file format (unlike PNG, which has this in the acTL chunk). The only way to know how many frames are in a .webp (as far as I know) is to read the entire file and count each of the frames, then multiply by the frame duration. Generally we don't do that, as it is impossible to know upfront how much data you would have to read, which is a performance problem.