Commit b5dfd48b authored by Ludger Sprenker's avatar Ludger Sprenker Committed by Alexandre Julliard

windowscodecs: Add initializations for tiff encoder options.

parent 6d6603b4
...@@ -499,7 +499,7 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o ...@@ -499,7 +499,7 @@ static void test_encoder_properties(const CLSID* clsid_encoder, IPropertyBag2 *o
} }
if (clsid_encoder == &CLSID_WICTiffEncoder) if (clsid_encoder == &CLSID_WICTiffEncoder)
todo_wine test_specific_encoder_properties(options, testdata_tiff_props, all_props, cProperties2); test_specific_encoder_properties(options, testdata_tiff_props, all_props, cProperties2);
for (i=0; i < cProperties2; i++) for (i=0; i < cProperties2; i++)
{ {
......
...@@ -54,6 +54,9 @@ static CRITICAL_SECTION_DEBUG init_tiff_cs_debug = ...@@ -54,6 +54,9 @@ static CRITICAL_SECTION_DEBUG init_tiff_cs_debug =
}; };
static CRITICAL_SECTION init_tiff_cs = { &init_tiff_cs_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION init_tiff_cs = { &init_tiff_cs_debug, -1, 0, 0, 0, 0 };
static const WCHAR wszTiffCompressionMethod[] = {'T','i','f','f','C','o','m','p','r','e','s','s','i','o','n','M','e','t','h','o','d',0};
static const WCHAR wszCompressionQuality[] = {'C','o','m','p','r','e','s','s','i','o','n','Q','u','a','l','i','t','y',0};
static void *libtiff_handle; static void *libtiff_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f #define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR(TIFFClientOpen); MAKE_FUNCPTR(TIFFClientOpen);
...@@ -1909,7 +1912,31 @@ static HRESULT WINAPI TiffEncoder_CreateNewFrame(IWICBitmapEncoder *iface, ...@@ -1909,7 +1912,31 @@ static HRESULT WINAPI TiffEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = CreatePropertyBag2(NULL, 0, ppIEncoderOptions); PROPBAG2 opts[2]= {{0}};
opts[0].pstrName = (LPOLESTR)wszTiffCompressionMethod;
opts[0].vt = VT_UI1;
opts[0].dwType = PROPBAG2_TYPE_DATA;
opts[1].pstrName = (LPOLESTR)wszCompressionQuality;
opts[1].vt = VT_R4;
opts[1].dwType = PROPBAG2_TYPE_DATA;
hr = CreatePropertyBag2(opts, 2, ppIEncoderOptions);
if (SUCCEEDED(hr))
{
VARIANT v;
VariantInit(&v);
V_VT(&v) = VT_UI1;
V_UNION(&v, bVal) = WICTiffCompressionDontCare;
hr = IPropertyBag2_Write(*ppIEncoderOptions, 1, opts, &v);
VariantClear(&v);
if (FAILED(hr))
{
IPropertyBag2_Release(*ppIEncoderOptions);
*ppIEncoderOptions = NULL;
}
}
} }
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
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