| Previous | Next |
| WINCODEC_ERR_INVALIDQUERYREQUEST | WINCODEC_ERR_REQUESTONLYVALIDATMETADATAROOT |
WINCODEC_ERR_UNEXPECTEDMETADATATYPE
The metadata block exists, but it is the wrong schema
WINCODEC_ERR_UNEXPECTEDMETADATATYPE indicates a mismatch between the metadata format encountered in the image hierarchy and the format expected by the caller or codec. WIC identifies metadata readers and writers by metadata format GUIDs; EXIF IFD, XMP, IPTC, PNG text, and other block types have different item models even when they expose conceptually similar fields.
Casting the returned COM interface does not convert the underlying metadata schema. The caller should inspect the block reader’s metadata format and location before interpreting values or selecting a writer. When transcoding, copying a block into an incompatible container position can also produce this status even though the original block was valid in its source image.
Schema identification steps
- Enumerate the metadata block reader and capture each block’s format GUID.
- Compare the block location with the target container’s supported metadata layout.
- Choose a writer registered for the actual metadata format rather than a similarly named property set.
- Translate fields explicitly when moving metadata between incompatible schemas.
References
- Microsoft: metadata formats and block readers
- Microsoft: metadata handlers
- Microsoft: metadata reader and writer registration
Looking for a different code? Search another status or error code.