开发者

How to iterate all query paths within an image header namespace in WIC?

I开发者_开发知识库 am using Windows Imaging Component to read/write image metadata in my WPF application. I would like to know if there is an efficient way to know if any paths exist within a namespace. For instance I would like to know if any paths within IPTC namespace exist and if not I want to delete the namespace from the image header.

Any pointers would be greatly appreciated.

Thanks,

Murugesh.


Get an IWICMetadataQueryReader object and use its GetEnumerator method. With the IEnumString object returned from GetEnumerator, call its Next method to see if at least one metadata exists. If not then the metadata block is empty.

Trying to reach the IPTC namespace from the root query reader might be a bit trickier: the root may refer to the IPTC namespace (metadata block) as a single COM object sitting on the root, then you will need to figure out the type (interface) of that COM object and descend into it, much like exploring a tree.

I think it is typically not possible to control WIC what metadata not to write, as WIC is free to insert its own stuff as long as considered harmless.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜