Skip to content

bug: OpenImageIO fails to parse valid XMP when rdf:Description is self-closing #5021

@StonerLing

Description

@StonerLing

Hi,

I found that OpenImageIO fails to extract XMP metadata from some valid images
when the XMP uses a self-closing <rdf:Description ... /> element.

Example XMP :

<rdf:Description
    xmlns:Camera="xxxx/"
    Camera:CameraModel="xxxx"
    Camera:Pitch="-59/10"
    Camera:Roll="-27/10"
    Camera:Yaw="-459/10"
    ... />

This is valid XML, but OpenImageIO's decode_xmp() currently only looks for:

<rdf:Description> ... </rdf:Description>

and therefore does not enter the parsing loop if the tag is self-closing.

Example repro JPEG with self-closing rdf:Description XMP:

https://github.com/user-attachments/assets/30c0f3ec-322e-4f26-8450-e0371e15f1ca

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