From 7d039fc32d7d8fa46141c34d4fd2c5a42c9a6465 Mon Sep 17 00:00:00 2001 From: James Zern Date: Sat, 24 May 2014 18:30:33 -0700 Subject: [PATCH] cwebp: fallback to native webp decode in WIC builds this gives precedence to WIC, but attempts to decode the file as WebP if it fails Change-Id: I3d894f39a26aea88897a8ebd345139b82f74f312 --- examples/cwebp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/cwebp.c b/examples/cwebp.c index d52b319d..58a32993 100644 --- a/examples/cwebp.c +++ b/examples/cwebp.c @@ -94,6 +94,9 @@ static int ReadPicture(const char* const filename, WebPPicture* const pic, } else { // If no size specified, try to decode it using WIC. ok = ReadPictureWithWIC(filename, pic, keep_alpha, metadata); + if (!ok) { + ok = ReadWebP(filename, pic, keep_alpha, metadata); + } } if (!ok) { fprintf(stderr, "Error! Could not process file %s\n", filename);