From 540ac840878f2071717d969b27cd0b53821c40b6 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 20 Aug 2009 17:33:39 -0500 Subject: [PATCH] gdiplus: implement GdipGetImageDecoders[Size] --- dlls/gdiplus/image.c | 72 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 55 insertions(+), 17 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index cf48d87..c9e5287 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1364,10 +1364,10 @@ typedef struct image_codec { typedef enum { BMP, - NUM_ENCODERS_SUPPORTED + NUM_CODECS } ImageFormat; -static const struct image_codec codecs[NUM_ENCODERS_SUPPORTED]; +static const struct image_codec codecs[NUM_CODECS]; /***************************************************************************** * GdipSaveImageToStream [GDIPLUS.@] @@ -1408,7 +1408,7 @@ GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream, /* select correct encoder */ encode_image = NULL; - for (i = 0; i < NUM_ENCODERS_SUPPORTED; i++) { + for (i = 0; i < NUM_CODECS; i++) { if (IsEqualCLSID(clsid, &codecs[i].info.Clsid)) encode_image = codecs[i].encode_func; } @@ -1502,7 +1502,7 @@ static const WCHAR bmp_format[] = {'B', 'M', 'P', 0}; /* BMP */ static const BYTE bmp_sig_pattern[] = { 0x42, 0x4D }; static const BYTE bmp_sig_mask[] = { 0xFF, 0xFF }; -static const struct image_codec codecs[NUM_ENCODERS_SUPPORTED] = { +static const struct image_codec codecs[NUM_CODECS] = { { { /* BMP */ /* Clsid */ { 0x557cf400, 0x1a04, 0x11d3, { 0x9a, 0x73, 0x0, 0x0, 0xf8, 0x1e, 0xf3, 0x2e } }, @@ -1528,13 +1528,21 @@ static const struct image_codec codecs[NUM_ENCODERS_SUPPORTED] = { */ GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size) { - FIXME("%p %p stub!\n", numDecoders, size); + int decoder_count=0; + int i; + TRACE("%p %p\n", numDecoders, size); if (!numDecoders || !size) return InvalidParameter; - *numDecoders = 0; - *size = 0; + for (i=0; i