1

I have gone through the documentation at: http://msdn.microsoft.com/en-us/library/windows/desktop/ee719799(v=vs.85).aspx

As context, I am trying to encode in the JPEG-XR format and I want to emulate GDI+'s SetPropertyItem, GetPropertyItem functionality.

I basically have 3 questions:

  1. If I want to add a custom property to the exif header what is the correct query path?
  2. Can I use a custom ID, say {ushort=1111} to identify it and how do I verify if an ID is already defined?
  3. Is this the same as the id field of GdiPlus::PropertyItem?

For example, is the following valid:

PROPVARIANT    value;
value.vt = VT_LPWSTR;
value.pwszVal= L"Metadata Test";
hr = piFrameQWriter->SetMetadataByName(L"/ifd/exif/{ushort=1111}");

This code block succeeds, but when I try to read back the same metadata using:

IWICMetadataQueryReader *pQueryReader = NULL;
if(SUCCEEDED(hr))
{
    hr = piFrame->GetMetadataQueryReader(&pQueryReader);
}
if (SUCCEEDED(hr))
{
    PROPVARIANT value;
    hr = pQueryReader->GetMetadataByName(L"/ifd/exif/{ushort=1111}", &value);        
}

This returns E_INVALIDARG error.

I'd appreciate some help in understanding how this works. I feel like I have not understood the documentation correctly.

Thank you.

Sau
  • 326
  • 2
  • 15
  • 3
    Does the `value` need to be initialized before using it in the call to `GetMetadataByName`? At a minimum, I would try setting `value.vt` to `VT_EMPTY`. The function says its an in/out parameter, not just an out one, so you probably should make sure it's initialized. – Adrian McCarthy Jan 04 '13 at 00:42
  • @Sau Were you able to resolve this? – Vivek Kumar Nov 18 '22 at 07:20

0 Answers0