| Previous | Next |
| WINCODEC_ERR_DUPLICATEMETADATAPRESENT | WINCODEC_ERR_UNEXPECTEDSIZE |
WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE
Metadata identity and value type are separate constraints
WINCODEC_ERR_PROPERTYUNEXPECTEDTYPE indicates that the metadata item was addressed, but its PROPVARIANT type was not the type expected by the handler or schema. An integer tag is not interchangeable with a numeric string, a byte vector, or a rational encoded as two integers. Automatic language conversions can also change signedness or widen a scalar into a type the codec does not accept.
The fix is to inspect both the query path and vt field. Existing image metadata can itself contain a surprising type, while writes can fail because the application constructed the wrong variant. Converting everything to text loses binary and rational semantics and can create files that another reader interprets differently.
Type-level diagnosis
- Log the query, metadata schema,
PROPVARIANT.vt, and value size. - Compare the type with the native image-format query examples for that tag.
- Preserve arrays, blobs, rationals, and signed values in their expected representation.
- Clear every initialized
PROPVARIANTcorrectly after the operation.
References
- Microsoft: WIC metadata query language and typed values
- Microsoft: native-format metadata queries
- Microsoft: metadata reader and writer values
Looking for a different code? Search another status or error code.