Skip to content

Cannot retrieve dimensions from a PNG if read through ApngDecoder because of a missing trait #2763

@amyspark

Description

@amyspark

This happens in image-rs 0.25.9

Expected

I'm relying on the decoders supporting both AnimationDecoder and ImageDecoder traits in order to query image dimensions and then extract the individual frames for downstream consumption.

Actual behaviour

This is the case for GifDecoder and WebpDecoder, but not for ApngDecoder. The latter exposes animation frames, but not the dimensions, so for that particular format I cannot broadcast the information to the rest of the pipeline.

I think this can be fixed by simply forwarding the relevant trait functions to the underlying decoder.

Reproduction steps

Clone and cargo build the following repo: https://github.com/amyspark/imagers-apng-test.git

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2856 for further context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions