windowscodecs: Implement IWICBitmapFrameDecode::GetColorContexts for TIFF images.
This commit is contained in:
parent
e002d2eacf
commit
d8c71dd5ed
|
@ -1105,8 +1105,34 @@ static HRESULT WINAPI TiffFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDeco
|
|||
static HRESULT WINAPI TiffFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface,
|
||||
UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
|
||||
{
|
||||
FIXME("(%p,%u,%p,%p): stub\n", iface, cCount, ppIColorContexts, pcActualCount);
|
||||
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
|
||||
TiffFrameDecode *This = impl_from_IWICBitmapFrameDecode(iface);
|
||||
const BYTE *profile;
|
||||
UINT len;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
|
||||
|
||||
EnterCriticalSection(&This->parent->lock);
|
||||
|
||||
if (pTIFFGetField(This->parent->tiff, TIFFTAG_ICCPROFILE, &len, &profile))
|
||||
{
|
||||
if (cCount && ppIColorContexts)
|
||||
{
|
||||
hr = IWICColorContext_InitializeFromMemory(*ppIColorContexts, profile, len);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
LeaveCriticalSection(&This->parent->lock);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
*pcActualCount = 1;
|
||||
}
|
||||
else
|
||||
*pcActualCount = 0;
|
||||
|
||||
LeaveCriticalSection(&This->parent->lock);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI TiffFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface,
|
||||
|
|
Loading…
Reference in New Issue