Skip to content

Commit

Permalink
fix wic on win7
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Feb 23, 2020
1 parent 7183323 commit 6573909
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wic_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 20,7 @@ unsigned char* wic_decode_image(const wchar_t* filepath, int* w, int* h, int* c)
int stride = 0;
unsigned char* bgrdata = 0;

if (CoCreateInstance(CLSID_WICImagingFactory, 0, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory)))
if (CoCreateInstance(CLSID_WICImagingFactory1, 0, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory)))
goto RETURN;

if (factory->CreateDecoderFromFilename(filepath, 0, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &decoder))
Expand Down Expand Up @@ -89,7 89,7 @@ int wic_encode_image(const wchar_t* filepath, int w, int h, int c, void* bgrdata
unsigned char* data = 0;
int ret = 0;

if (CoCreateInstance(CLSID_WICImagingFactory, 0, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory)))
if (CoCreateInstance(CLSID_WICImagingFactory1, 0, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory)))
goto RETURN;

if (factory->CreateStream(&stream))
Expand Down

0 comments on commit 6573909

Please sign in to comment.