windowscodecs: Implement GetThumbnail in the ICO frame decoder. Take 2.
Dmitry Timoshkov
dmitry at baikal.ru
Wed Jan 30 10:48:05 CST 2013
This one should work better.
---
dlls/windowscodecs/icoformat.c | 4 ++--
dlls/windowscodecs/tests/icoformat.c | 17 ++++++++++++-----
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c
index 7aec245..ec09aa6 100644
--- a/dlls/windowscodecs/icoformat.c
+++ b/dlls/windowscodecs/icoformat.c
@@ -200,8 +200,8 @@ static HRESULT WINAPI IcoFrameDecode_GetColorContexts(IWICBitmapFrameDecode *ifa
static HRESULT WINAPI IcoFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface,
IWICBitmapSource **ppIThumbnail)
{
- FIXME("(%p,%p)\n", iface, ppIThumbnail);
- return E_NOTIMPL;
+ TRACE("(%p,%p)\n", iface, ppIThumbnail);
+ return IWICBitmapFrameDecode_QueryInterface(iface, &IID_IWICBitmapSource, (void **)ppIThumbnail);
}
static const IWICBitmapFrameDecodeVtbl IcoFrameDecode_Vtbl = {
diff --git a/dlls/windowscodecs/tests/icoformat.c b/dlls/windowscodecs/tests/icoformat.c
index e9c0a48..c53739d 100644
--- a/dlls/windowscodecs/tests/icoformat.c
+++ b/dlls/windowscodecs/tests/icoformat.c
@@ -133,17 +133,24 @@ static void test_bad_icondirentry_size(void)
if (SUCCEEDED(hr))
{
- UINT width = 0, height = 0;
- IWICBitmapSource *thumbnail = NULL;
+ UINT width, height;
+ IWICBitmapSource *thumbnail;
+ width = height = 0;
hr = IWICBitmapFrameDecode_GetSize(framedecode, &width, &height);
ok(hr == S_OK, "GetFrameSize failed, hr=%x\n", hr);
ok(width == 16 && height == 16, "framesize=%ux%u\n", width, height);
hr = IWICBitmapFrameDecode_GetThumbnail(framedecode, &thumbnail);
- todo_wine ok(hr == S_OK, "GetThumbnail failed, hr=%x\n", hr);
-
- if (thumbnail) IWICBitmapSource_Release(thumbnail);
+ ok(hr == S_OK, "GetThumbnail failed, hr=%x\n", hr);
+ if (hr == S_OK)
+ {
+ width = height = 0;
+ hr = IWICBitmapSource_GetSize(thumbnail, &width, &height);
+ ok(hr == S_OK, "GetFrameSize failed, hr=%x\n", hr);
+ ok(width == 16 && height == 16, "framesize=%ux%u\n", width, height);
+ IWICBitmapSource_Release(thumbnail);
+ }
IWICBitmapFrameDecode_Release(framedecode);
}
--
1.8.0.2
More information about the wine-patches
mailing list