windowscodecs: Implement GetSize for the TIFF decoder.

This commit is contained in:
Vincent Povirk 2010-03-19 15:27:51 -05:00 committed by Alexandre Julliard
parent 8066e9beca
commit 8996ffbfc6
1 changed files with 23 additions and 2 deletions

View File

@ -198,6 +198,7 @@ typedef struct {
int bpp;
int indexed;
int reverse_bgr;
UINT width, height;
} tiff_decode_info;
typedef struct {
@ -275,6 +276,20 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
return E_FAIL;
}
ret = pTIFFGetField(tiff, TIFFTAG_IMAGEWIDTH, &decode_info->width);
if (!ret)
{
WARN("missing image width\n");
return E_FAIL;
}
ret = pTIFFGetField(tiff, TIFFTAG_IMAGELENGTH, &decode_info->height);
if (!ret)
{
WARN("missing image length\n");
return E_FAIL;
}
return S_OK;
}
@ -552,8 +567,14 @@ static ULONG WINAPI TiffFrameDecode_Release(IWICBitmapFrameDecode *iface)
static HRESULT WINAPI TiffFrameDecode_GetSize(IWICBitmapFrameDecode *iface,
UINT *puiWidth, UINT *puiHeight)
{
FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
return E_NOTIMPL;
TiffFrameDecode *This = (TiffFrameDecode*)iface;
*puiWidth = This->decode_info.width;
*puiHeight = This->decode_info.height;
TRACE("(%p) <-- %ux%u\n", iface, *puiWidth, *puiHeight);
return S_OK;
}
static HRESULT WINAPI TiffFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,