diff options
author | Urvang Joshi <urvang@google.com> | 2014-11-06 13:52:48 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2015-03-02 18:43:08 -0800 |
commit | 046732ca65979fcc3dc89e03286a6d9a9afc6d87 (patch) | |
tree | 8fa1edd9ce494b91e9596b8f1b2ff8ebe67524c0 | |
parent | 4426f50179442edb03e06b12359526d2e407b77e (diff) | |
download | libwebp-046732ca65979fcc3dc89e03286a6d9a9afc6d87.tar.gz |
WebPEncode: Support encoding same pic twice (even if modified)
This wasn't working for this specific scenario:
- Encode an RGBA 'pic' (with trivial alpha) using lossy encoding.
(so that pic->a == NULL after import happens).
- Modify the 'pic->argb' so that it has non-trivial alpha.
- Encode the same 'pic' again.
This used to fail to encode alpha data as pic->a == NULL.
(cherry picked from commit e4f4dddba3719faaeebe5bc74c2436756b966d44)
Change-Id: Ieaaa7bd09825c42f54fbd99e6781d98f0b19cc0c
-rw-r--r-- | src/enc/webpenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/enc/webpenc.c b/src/enc/webpenc.c index 0cb83f12..ca85e0b8 100644 --- a/src/enc/webpenc.c +++ b/src/enc/webpenc.c @@ -326,7 +326,7 @@ int WebPEncode(const WebPConfig* config, WebPPicture* pic) { if (!config->lossless) { VP8Encoder* enc = NULL; - if (pic->y == NULL || pic->u == NULL || pic->v == NULL) { + if (pic->use_argb || pic->y == NULL || pic->u == NULL || pic->v == NULL) { // Make sure we have YUVA samples. if (config->preprocessing & 4) { #if WEBP_ENCODER_ABI_VERSION > 0x0204 |