Module: wine Branch: master Commit: 0ab6e9853c4a3a2db2216daf4141519356169b58 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0ab6e9853c4a3a2db2216daf41...
Author: Vincent Povirk vincent@codeweavers.com Date: Mon Aug 24 12:29:02 2009 -0500
windowscodecs: Implement GetPixelFormat for the JPEG decoder.
---
dlls/windowscodecs/jpegformat.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index 38292bd..69a07db 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -399,8 +399,13 @@ static HRESULT WINAPI JpegDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface, static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface, WICPixelFormatGUID *pPixelFormat) { - FIXME("(%p,%p)\n", iface, pPixelFormat); - return E_NOTIMPL; + JpegDecoder *This = decoder_from_frame(iface); + TRACE("(%p,%p)\n", iface, pPixelFormat); + if (This->cinfo.out_color_space == JCS_RGB) + memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID)); + else /* This->cinfo.out_color_space == JCS_GRAYSCALE */ + memcpy(pPixelFormat, &GUID_WICPixelFormat8bppGray, sizeof(GUID)); + return S_OK; }
static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *iface,