Commit fb87ee24 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Make JPEG decoder fallback to 96 dpi resolution for density_unit == 0 case.

parent 6ee48664
...@@ -548,16 +548,23 @@ static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifa ...@@ -548,16 +548,23 @@ static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *ifa
EnterCriticalSection(&This->lock); EnterCriticalSection(&This->lock);
if (This->cinfo.density_unit == 2) /* pixels per centimeter */ switch (This->cinfo.density_unit)
{ {
case 2: /* pixels per centimeter */
*pDpiX = This->cinfo.X_density * 2.54; *pDpiX = This->cinfo.X_density * 2.54;
*pDpiY = This->cinfo.Y_density * 2.54; *pDpiY = This->cinfo.Y_density * 2.54;
} break;
else
{ case 1: /* pixels per inch */
/* 1 = pixels per inch, 0 = unknown */
*pDpiX = This->cinfo.X_density; *pDpiX = This->cinfo.X_density;
*pDpiY = This->cinfo.Y_density; *pDpiY = This->cinfo.Y_density;
break;
case 0: /* unknown */
default:
*pDpiX = 96.0;
*pDpiY = 96.0;
break;
} }
LeaveCriticalSection(&This->lock); LeaveCriticalSection(&This->lock);
......
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