From a89a3230c91f5a33f11f60f7e11d020de0af327d Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 16 Jul 2021 12:16:54 -0700 Subject: [PATCH] wicdec: support alpha from WebP WIC decoder the container check may not be strictly necessary now that the alpha check has matured and the library will detect usable alpha, but it's safer to fix this case first before making larger changes. Bug: webp:533 Change-Id: I2e1ba42156970d579a52bd183707a037e65fd900 --- imageio/wicdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imageio/wicdec.c b/imageio/wicdec.c index 880c99ac..42001c6e 100644 --- a/imageio/wicdec.c +++ b/imageio/wicdec.c @@ -273,10 +273,15 @@ int ReadPictureWithWIC(const char* const filename, WICPixelFormatGUID src_pixel_format = GUID_WICPixelFormatUndefined; const WICFormatImporter* importer = NULL; GUID src_container_format = GUID_NULL_; + // From Windows Kits\10\Include\10.0.19041.0\um\wincodec.h + WEBP_DEFINE_GUID(GUID_ContainerFormatWebp_, + 0xe094b0e2, 0x67f2, 0x45b3, + 0xb0, 0xea, 0x11, 0x53, 0x37, 0xca, 0x7c, 0xf3); static const GUID* kAlphaContainers[] = { &GUID_ContainerFormatBmp, &GUID_ContainerFormatPng, &GUID_ContainerFormatTiff, + &GUID_ContainerFormatWebp_, NULL }; int has_alpha = 0;