Commit 57e00c85 authored by Joel Holdsworth's avatar Joel Holdsworth Committed by Alexandre Julliard

windowscodecs: Implemented GifFrameDecode_GetResolution.

parent e66a2f6d
......@@ -123,8 +123,15 @@ static HRESULT WINAPI GifFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface
static HRESULT WINAPI GifFrameDecode_GetResolution(IWICBitmapFrameDecode *iface,
double *pDpiX, double *pDpiY)
{
FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY);
return E_NOTIMPL;
GifFrameDecode *This = (GifFrameDecode*)iface;
const GifWord aspect_word = This->parent->gif->SAspectRatio;
const double aspect = (aspect_word > 0) ? ((aspect_word + 15.0) / 64.0) : 1.0;
TRACE("(%p,%p,%p)\n", iface, pDpiX, pDpiY);
*pDpiX = 96.0 / aspect;
*pDpiY = 96.0;
return S_OK;
}
static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface,
......
......@@ -285,6 +285,7 @@ DGifGetScreenDesc(GifFileType * GifFile) {
GifFile->SColorResolution = (((Buf[0] & 0x70) + 1) >> 4) + 1;
BitsPerPixel = (Buf[0] & 0x07) + 1;
GifFile->SBackGroundColor = Buf[1];
GifFile->SAspectRatio = Buf[2];
if (Buf[0] & 0x80) { /* Do we have global color map? */
GifFile->SColorMap = MakeMapObject(1 << BitsPerPixel, NULL);
......
......@@ -100,7 +100,8 @@ typedef struct GifImageDesc {
typedef struct GifFileType {
GifWord SWidth, SHeight, /* Screen dimensions. */
SColorResolution, /* How many colors can we generate? */
SBackGroundColor; /* I hope you understand this one... */
SBackGroundColor, /* I hope you understand this one... */
SAspectRatio; /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */
ColorMapObject *SColorMap; /* NULL if not exists. */
int ImageCount; /* Number of current image */
GifImageDesc Image; /* Block describing current image */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment