mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
cwebp: fix jpg encodes on XP
correct has_alpha check; previously it was controlled by keep_alpha, which overrode the source format check. fixes issue #127 Change-Id: I414cfd9c5ed60b13673ccd2262ee5e4505ed6f6a
This commit is contained in:
parent
734f762a08
commit
72b96a6905
@ -179,18 +179,19 @@ static HRESULT ReadPictureWithWIC(const char* filename,
|
||||
IFS(IWICBitmapFrameDecode_GetPixelFormat(pFrame, &srcPixelFormat));
|
||||
IFS(IWICBitmapDecoder_GetContainerFormat(pDecoder, &srcContainerFormat));
|
||||
|
||||
has_alpha = keep_alpha;
|
||||
for (i = 0;
|
||||
has_alpha && i < sizeof(alphaContainers)/sizeof(alphaContainers[0]);
|
||||
++i) {
|
||||
if (IsEqualGUID(MAKE_REFGUID(srcContainerFormat),
|
||||
MAKE_REFGUID(*alphaContainers[i]))) {
|
||||
has_alpha =
|
||||
IsEqualGUID(MAKE_REFGUID(srcPixelFormat),
|
||||
MAKE_REFGUID(GUID_WICPixelFormat32bppRGBA_)) ||
|
||||
IsEqualGUID(MAKE_REFGUID(srcPixelFormat),
|
||||
MAKE_REFGUID(GUID_WICPixelFormat32bppBGRA_));
|
||||
break;
|
||||
if (keep_alpha) {
|
||||
for (i = 0;
|
||||
i < sizeof(alphaContainers) / sizeof(alphaContainers[0]);
|
||||
++i) {
|
||||
if (IsEqualGUID(MAKE_REFGUID(srcContainerFormat),
|
||||
MAKE_REFGUID(*alphaContainers[i]))) {
|
||||
has_alpha =
|
||||
IsEqualGUID(MAKE_REFGUID(srcPixelFormat),
|
||||
MAKE_REFGUID(GUID_WICPixelFormat32bppRGBA_)) ||
|
||||
IsEqualGUID(MAKE_REFGUID(srcPixelFormat),
|
||||
MAKE_REFGUID(GUID_WICPixelFormat32bppBGRA_));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user