Vincent Povirk : windowscodecs: Implement GetSize for the TIFF decoder.
Alexandre Julliard
julliard at winehq.org
Mon Mar 22 11:12:03 CDT 2010
Module: wine
Branch: master
Commit: 8996ffbfc68de31d2059a9a1752b41565f49b55f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8996ffbfc68de31d2059a9a1752b41565f49b55f
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Fri Mar 19 15:27:51 2010 -0500
windowscodecs: Implement GetSize for the TIFF decoder.
---
dlls/windowscodecs/tiffformat.c | 25 +++++++++++++++++++++++--
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index 83b9667..ad8a81f 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -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,
More information about the wine-cvs
mailing list