From 1df2caac70d0a6d69ccb5a303293622938c9f4cb Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 13 Aug 2009 16:41:35 -0500 Subject: [PATCH] windowscodecs: register the PNG decoder --- dlls/windowscodecs/regsvr.c | 36 +++++++++++++++++++++++++++++++++++- 1 files changed, 35 insertions(+), 1 deletions(-) diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 12ef7d8..81218b9 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -777,7 +777,7 @@ static struct regsvr_coclass const coclass_list[] = { /*********************************************************************** * decoder list */ -static const BYTE mask_all[] = {0xff,0xff,0xff,0xff,0xff,0xff}; +static const BYTE mask_all[] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}; static const BYTE bmp_magic[] = {0x42,0x4d}; @@ -838,6 +838,30 @@ static struct decoder_pattern const jpeg_patterns[] = { {0} }; +static const BYTE png_magic[] = {137,80,78,71,13,10,26,10}; + +static GUID const * const png_formats[] = { + &GUID_WICPixelFormatBlackWhite, + &GUID_WICPixelFormat2bppGray, + &GUID_WICPixelFormat4bppGray, + &GUID_WICPixelFormat8bppGray, + &GUID_WICPixelFormat16bppGray, + &GUID_WICPixelFormat32bppBGRA, + &GUID_WICPixelFormat64bppRGBA, + &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat2bppIndexed, + &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, + &GUID_WICPixelFormat24bppBGR, + &GUID_WICPixelFormat48bppRGB, + NULL +}; + +static struct decoder_pattern const png_patterns[] = { + {8,0,png_magic,mask_all,0}, + {0} +}; + static struct regsvr_decoder const decoder_list[] = { { &CLSID_WICBmpDecoder, "The Wine Project", @@ -879,6 +903,16 @@ static struct regsvr_decoder const decoder_list[] = { jpeg_formats, jpeg_patterns }, + { &CLSID_WICPngDecoder, + "The Wine Project", + "PNG Decoder", + "1.0.0.0", + &GUID_VendorMicrosoft, + "image/png", + ".png", + png_formats, + png_patterns + }, { NULL } /* list terminator */ }; -- 1.5.4.3