Vincent Povirk : windowscodecs: Implement IWICBitmap::GetSize.

Alexandre Julliard julliard at winehq.org
Thu Aug 16 15:26:15 CDT 2012


Module: wine
Branch: master
Commit: a62bd245a4d36ef18a931ed93d959f7e953b9617
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a62bd245a4d36ef18a931ed93d959f7e953b9617

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Tue Aug 14 15:49:02 2012 -0500

windowscodecs: Implement IWICBitmap::GetSize.

---

 dlls/windowscodecs/bitmap.c       |   11 +++++++++--
 dlls/windowscodecs/tests/bitmap.c |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c
index 0a7ecf5..22a4876 100644
--- a/dlls/windowscodecs/bitmap.c
+++ b/dlls/windowscodecs/bitmap.c
@@ -266,9 +266,16 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
 static HRESULT WINAPI BitmapImpl_GetSize(IWICBitmap *iface,
     UINT *puiWidth, UINT *puiHeight)
 {
-    FIXME("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
+    BitmapImpl *This = impl_from_IWICBitmap(iface);
+    TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
 
-    return E_NOTIMPL;
+    if (!puiWidth || !puiHeight)
+        return E_INVALIDARG;
+
+    *puiWidth = This->width;
+    *puiHeight = This->height;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface,
diff --git a/dlls/windowscodecs/tests/bitmap.c b/dlls/windowscodecs/tests/bitmap.c
index fc45375..a0926ab 100644
--- a/dlls/windowscodecs/tests/bitmap.c
+++ b/dlls/windowscodecs/tests/bitmap.c
@@ -256,12 +256,12 @@ todo_wine {
     ok(hr == S_OK, "IWICBitmap_GetResolution failed hr=%x\n", hr);
     ok(dpix == 12.0, "got %f, expected 12.0\n", dpix);
     ok(dpiy == 34.0, "got %f, expected 34.0\n", dpiy);
+}
 
     hr = IWICBitmap_GetSize(bitmap, &width, &height);
     ok(hr == S_OK, "IWICBitmap_GetSize failed hr=%x\n", hr);
     ok(width == 3, "got %d, expected 3\n", width);
     ok(height == 3, "got %d, expected 3\n", height);
-}
 
     IWICBitmap_Release(bitmap);
 }




More information about the wine-cvs mailing list