Commit 77a5b635 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Set flags and dpi when images are loaded.

parent 1ce8be01
......@@ -2606,6 +2606,18 @@ static GpStatus decode_image_wic(IStream* stream, REFCLSID clsid, GpImage **imag
*image = NULL;
GdipDisposeImage((GpImage*)bitmap);
}
if (SUCCEEDED(hr) && status == Ok)
{
double dpix, dpiy;
hr = IWICBitmapSource_GetResolution(source, &dpix, &dpiy);
if (SUCCEEDED(hr))
{
bitmap->image.xres = dpix;
bitmap->image.yres = dpiy;
}
hr = S_OK;
}
}
IWICBitmapSource_Release(source);
......@@ -2621,6 +2633,12 @@ end:
if (FAILED(hr) && status == Ok) status = hresult_to_status(hr);
if (status == Ok)
{
/* Native GDI+ used to be smarter, but since Win7 it just sets these flags. */
bitmap->image.flags |= ImageFlagsReadOnly|ImageFlagsHasRealPixelSize|ImageFlagsHasRealDPI|ImageFlagsColorSpaceRGB;
}
return status;
}
......
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