DioxusLabs / manganis

An asset system for the Rust ecosystem
44 stars 12 forks source link

Optimizer disallows animation #65

Open samtay opened 3 months ago

samtay commented 3 months ago

Problem

When manganis optimizes an animated webp/avif/gif file, it appears to strip the animation to a static image.

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

The image should be animated.

Environment:

Questionnaire

ealmloff commented 3 months ago

You can explicitly mark an asset as a video with the video function: manganis::mg!(video("assets/animated.webp"))

manganis should try to detect videos automatically from the content. It looks like the image crate has some limited support for frames. If you are interested in working on this, we could skip re-encoding the image if it has more than one frame.